Skip to content

Instantly share code, notes, and snippets.

LLM Wiki

A pattern for building personal knowledge bases using LLMs.

This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.

The core idea

Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.

@userx14
userx14 / sysxToBin.py
Last active April 17, 2026 10:39
Circuit tracks firmware reverse engineering
import numpy as np
from pathlib import Path
import crcmod
import sys
def extract_sysex_messages(syx_path):
commands_list = dict([
(0x71, "UPDATE_INIT"),
(0x72, "UPDATE_WRITE"),
(0x73, "UPDATE_FINISH"),
@userx14
userx14 / midiFeedback.ino
Last active November 1, 2025 22:39
Novation Circuit Tracks chromatic sample playback with MIDI.
#include <MIDI.h>
#define MidiInChannel 3 //default setting of MIDI 1 out channel for circuit tracks
#define MidiDrumChannel 10 //drum 1 channel, other drums on 61,62,63
#define MidiDrumNote 60 //drum 1 channel, other drums on 61,62,63
#define pitchRelativeTo 60 //sample is unpitched for c4 = midi note 60
const float twelfthRootOfTwo = 1.0594631; //frequency ratio between adjacent semitones
@bjoern-r
bjoern-r / Huawei_E3372_openwrt.md
Last active June 11, 2026 11:13
How to use a Huawei E3372 on OpenWRT

HOWTO use a Huawei E3372 on OpenWRT

This modem is also sold as a MegaFon M150-2 USB dongle

Needed Software

Install the needed packages via opkg tool

opkg update
import django_filters
class CommaSeparatedValueFilter(django_filters.CharFilter):
"""Accept comma separated string as value and convert it to list.
It's useful for __in lookups.
"""
def filter(self, qs, value):
@Karmak23
Karmak23 / drf-no-none.py
Last active March 10, 2023 04:47
django-rest-framework Model Serializer base class to exclude None/null values from output.
class WithoutNoneFieldsSerializer(serializers.ModelSerializer):
""" Exclude model fields which are ``None``.
This eventually includes foreign keys and other special fields.
Source: https://gist.github.com/Karmak23/5a40beb1e18da7a61cfc
"""
def to_native(self, obj):
@Karmak23
Karmak23 / drf_logger.py
Last active November 29, 2020 00:53
Django Rest Framework logger mixin
class DRFLoggerMixin(object):
"""
Allows us to log any incoming request and to know what's in it.
Usage:
class MyOwnViewSet(DRFLoggerMixin,
mixins.ListModelMixin,
…
viewsets.GenericViewSet):
@ricardo-rossi
ricardo-rossi / ElasticSearch.sh
Last active June 30, 2026 15:32
Installing ElasticSearch on Ubuntu 14.04
#!/bin/bash
### USAGE
###
### ./ElasticSearch.sh 1.7 will install Elasticsearch 1.7
### ./ElasticSearch.sh will fail because no version was specified (exit code 1)
###
### CLI options Contributed by @janpieper
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch
"""Here's how you implement Foo(pkid) with postgres.orm 2.1.x.
Discovered at PyTennesse with @wlphoenix @PederSchacht et al.
"""
class Foo(Model):
typname = 'foo'
def __new__(cls, pkid_or_record):
@aaugustin
aaugustin / HOWTO.md
Last active December 3, 2019 20:18
Connecting a Django application to a Microsoft SQL Server database from Debian GNU/Linux
  1. Install and register the FreeTDS driver for unixODBC.

     apt-get install tdsodbc
     odbcinst -i -d -f /usr/share/tdsodbc/odbcinst.ini
    
  2. (Optional) Test the DSN-less connection with pyodbc.

     apt-get install python-pyodbc
    

>>> import pyodbc