Skip to content

Instantly share code, notes, and snippets.

View samuelcastro's full-sized avatar
🎯
Building

Sam Silva samuelcastro

🎯
Building
View GitHub Profile

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.

@rpggio
rpggio / parseOrNull.ts
Last active September 26, 2024 20:28
React hook to persist MUI DataGrid column settings
/**
* If argument is a string, try to parse as JSON.
* Otherwise return null.
*/
export function parseOrNull(raw: unknown) {
if (!raw) return null
if (typeof raw === 'string') {
try {
return JSON.parse(raw)
@leomelzer
leomelzer / Dockerfile
Last active March 9, 2022 19:18
Install private NPM dependencies using git+ssh on Now. Based on https://zeit.co/blog/build-env to work around missing support for git+ssh dependencies in now@2 (https://github.com/zeit/now-builders/issues/49)
# This is a multi-stage build to not spill the contents of the deploy_key
FROM mhart/alpine-node:10 as base
# We need git and openssh to resolve `git+ssh` links in package.json
RUN apk update \
&& apk add git openssh
WORKDIR /usr/src
COPY package*.json ./
// this code is safe to copy/paste into your browser
// but you should really try to write it out line-by-line ;)
// this gist is based on a number of other excellent introductions to lambda calculus
// classic: https://github.com/sjsyrek/presentations/blob/master/lambda-calculus/lambda.js
// ornithology: https://www.youtube.com/watch?v=3VQ382QG-y4&t=3349s
// and this one, in Ruby, called "Programming With Nothing" (excellent title) https://www.youtube.com/watch?v=VUhlNx_-wYk
pair = x => y => a => a(x)(y)
@staltz
staltz / introrx.md
Last active May 19, 2026 02:25
The introduction to Reactive Programming you've been missing
@gosukiwi
gosukiwi / .vimrc
Last active December 4, 2025 22:27
.vimrc
" ---------------------- USABILITY CONFIGURATION ----------------------
" Basic and pretty much needed settings to provide a solid base for
" source code editting
" don't make vim compatible with vi
set nocompatible
" turn on syntax highlighting
syntax on
" and show line numbers
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 18, 2026 05:58
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k