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.

@okets
okets / gist:b2bdf3ba2ab96c27ad58274372298261
Last active August 29, 2024 16:01
figure out the room Valetudo robot is right now.
const mapData = msg.payload;
const _pixelSize = mapData.pixelSize;
let _robotXY = null;
for (let i = 0; i < mapData.entities.length; i++) {
if (mapData.entities[i].type == "robot_position") {
_robotXY = {
x: Math.floor(mapData.entities[i].points[0] / _pixelSize),
y: Math.floor(mapData.entities[i].points[1] / _pixelSize)
};
break;
@pykler
pykler / wink_relay_publish.py
Last active September 26, 2023 13:32
Script to publish mqtt discovery for wink relay running with https://github.com/jimpastos/wink-relay-manager
import json
import logging
import getpass
import argparse
import paho.mqtt.client as mqtt # paho-mqtt
payloads = {
"homeassistant/device_automation/B0C1/%MQTT_PREFIX%/config": {
"automation_type":"trigger",
"topic": "%MQTT_PREFIX%/buttons/0/click/1",