Skip to content

Instantly share code, notes, and snippets.

@chris2k20
chris2k20 / llm-wiki.md
Created August 13, 2026 18:24 — 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.

@chris2k20
chris2k20 / docker-mysql-mariadb-upgrade-docker-container.sh
Last active June 12, 2022 20:21
Run a mysql_upgrade in all mysql/mariadb docker containers
# run the following command in your terminal to:
# - run a mysql_upgrade command in every container
# - kill the container to restart the mariadb
for x in $(docker ps | grep -i mariadb:latest | awk '{print $1;}'); do echo container $x now updating...; docker exec $x bin/sh -c 'mysql_upgrade --user=root --password=$(printenv MYSQL_ROOT_PASSWORD) ; kill 1'; done
@chris2k20
chris2k20 / Proxmox-Cloudinit-Ubuntu-20.10.sh
Last active November 3, 2022 00:36
Proxmox-Cloudinit-Ubuntu-20.10.sh
#!/bin/bash
# Creats a Ubuntu 20.10 Cloud-Init Ready VM Template in Proxmox
#
# Ubuntu 20.04: https://gist.github.com/chris2k20/dba14515071bd5a14e48cf8b61f7d2e2
# Ubuntu 20.10: https://gist.github.com/chris2k20/181ef4e4308e678657459d40ea94af90
export IMAGENAME="groovy-server-cloudimg-amd64.img"
export IMAGEURL="https://cloud-images.ubuntu.com/groovy/current/"
@chris2k20
chris2k20 / Proxmox-Cloudinit.sh
Last active September 29, 2024 19:35
Proxmox Cloud-Init Template Creation Bash-Script (Ubuntu)
#!/bin/bash
# Creates a Ubuntu Cloud-Init Ready VM Template in Proxmox
#
# Update the image name and URL for Ubuntu 22.04 LTS
export IMAGENAME="jammy-server-cloudimg-amd64.img"
export IMAGEURL="https://cloud-images.ubuntu.com/jammy/current/"
export STORAGE="local-zfs-cache"
export VMNAME="ubuntu-2204-cloudinit-template"
export VMID=902204
@chris2k20
chris2k20 / wildcard
Created November 4, 2020 08:35
wildcard
*
@chris2k20
chris2k20 / wg-create-user.sh
Created October 29, 2020 14:30
Automate creation of a Wireguard User Key, Public-Key, PSK
#!/bin/bash
# Usage: ./wg-create-user.sh my-user
# Creats wiregard key, pub, psk
# Read vars
read -p "Client name: " -e -i $1 CLIENT
# Test vars, files
if [[ "$CLIENT" = "" ]]; then
echo "Sorry, you need a Client-Name"
exit 2
@chris2k20
chris2k20 / ssh-multi.sh
Created May 1, 2020 12:04 — forked from pstray/ssh-multi.sh
Start tmux and ssh to multiple hosts with synchronized input
#! /bin/bash
if [ -z "$1" ]; then
echo "please supply at least one server to connect to" >&2
exit 1
fi
target=multi-ssh-$$
if [ -z "$TMUX" ]; then