Skip to content

Instantly share code, notes, and snippets.

@adhsu
adhsu / llm-wiki.md
Created May 12, 2026 22:20 — 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.

@adhsu
adhsu / README.md
Last active May 6, 2020 18:51
Speak/Retool

Our app contains courses that are split into units, and each unit is split into days, and each day has several lessons. We want to use Retool to build an internal tool that allows us to easily edit this course. This means editing course/unit/day info, adding/removing units in a course, adding/removing days in a unit, adding/removing lessons in a day, etc.

course-outline.json is the json skeleton for 1 course. It's a big nested json blob. As you can see:

  1. Each course object contains some info and an array of units.
  2. Each unit contains some info and an array of days.
  3. Each day contains some details including an array of lessons.

speak-course.json is real data.

Here is a screenshot of the custom internal course editor we built, to illustrate what an editor would look like:

import React, { Component, PropTypes } from 'react'
import emojis from '../helpers/emojis-short'
const addReactionImg = require('../static/images/add-reaction.png')
export default class EmojiPicker extends Component {
constructor() {
super();
this.state = {
pickerIsOpen: false
}
@adhsu
adhsu / gulpfile.js
Created December 22, 2015 19:44
gulpfile with babelify stage 0
var source = require('vinyl-source-stream');
var gulp = require('gulp');
var gutil = require('gulp-util');
var browserify = require('browserify');
var babelify = require('babelify');
var watchify = require('watchify');
var notify = require('gulp-notify');
var stylus = require('gulp-stylus');
var autoprefixer = require('gulp-autoprefixer');
@adhsu
adhsu / FlintCart
Created February 4, 2015 00:46
FlintCart
Store Items {
search s: searchBy s @items
State {
items: [ // #items for live 2-way binding to a db
{
image: "https://d2lnr5mha7bycj.cloudfront.net/itemimage/image/primary_6748ee54-b207-4018-b631-fb410a22edc2.jpg"
name: "Banana"
price: 0.24
department: "Produce"