Skip to content

Instantly share code, notes, and snippets.

View dheerapat's full-sized avatar

Dheerapat Tookkane dheerapat

View GitHub Profile
@dheerapat
dheerapat / llm-wiki.md
Created April 21, 2026 17:01 — forked from karpathy/llm-wiki.md
llm-wiki

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.

@dheerapat
dheerapat / lobster-race-condition.md
Created February 11, 2026 09:30
race condition fix

Ah, I see the issue! This is a race condition in your queue processing system. Let me explain what's happening:

The Problem

When you send two messages quickly:

  1. Message 1 ("weather") → enqueued
  2. Message 2 ("news") → enqueued
  3. Processing loop picks up Message 1 → calls agent.process(msg1)
  4. Before Message 1 finishes processing, the loop picks up Message 2 → calls agent.process(msg2)
@dheerapat
dheerapat / docker.yaml
Last active January 28, 2026 05:32
lakehouse-lakekeeper
services:
postgres-db:
image: postgres:latest
container_name: postgres-db
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: pass
POSTGRES_DB: postgres
TZ: UTC
ports:
enum WarehouseLocationERP {
Thaphra = 'WH02',
Thairath = 'WH03',
Province = 'WH90',
MachineInventory = 'WH25'
}
enum VirtualWarehouseERP {
ReadyToUseWarehouse = '02',
Machine = '03',
@dheerapat
dheerapat / re-test.py
Last active October 5, 2024 17:49
python regex example
import re
txt = """<|python_tag|><function=spotify_song_artist>{"n": "[\"BIRDS OF A FEATHER\", \"Espresso\", \"Please Please Please\", \"Not Like Us\", \"Gata Only\"]"}</function>"""
x = re.search("<function=(\w+)>(.*?)</function>", txt)
if x:
print("YES! We have a match!")
print(x.group())
else:
print("No match")
@dheerapat
dheerapat / .bashrc
Last active July 29, 2024 11:23
personal .bashrc alias and env
# shorten path at prompt to only 1 level above current file
export PROMPT_DIRTRIM=1
# start and stop docker-destop (in case clicking icon not working)
alias docker-desktop-start='systemctl --user start docker-desktop'
alias docker-desktop-stop='systemctl --user stop docker-desktop'