Skip to content

Instantly share code, notes, and snippets.

@oldcai
oldcai / llm-wiki.md
Created April 6, 2026 04:45 — 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.

@oldcai
oldcai / celery.sh
Created January 7, 2023 00:49 — forked from amatellanes/celery.sh
Celery handy commands
/* Useful celery config.
app = Celery('tasks',
broker='redis://localhost:6379',
backend='redis://localhost:6379')
app.conf.update(
CELERY_TASK_RESULT_EXPIRES=3600,
CELERY_QUEUES=(
Queue('default', routing_key='tasks.#'),
@oldcai
oldcai / list.md
Created April 24, 2022 03:55 — forked from ih2502mk/list.md
Quantopian Lectures Saved
@oldcai
oldcai / backup_rancher.sh
Last active October 25, 2020 16:43
rancher server daily backup script
#!/bin/bash
version='stable'
#version='latest'
mkdir -p /var/backups/rancher
cd /var/backups/rancher
container_id=$(docker ps|grep rancher:${version}|awk '{ print $1 }')
echo $container_id
docker stop $container_id
today=$(date +%Y%m%d)
docker create --volumes-from $container_id --name rancher-data-$today rancher/rancher:${version}
@oldcai
oldcai / 500px.user.js
Last active April 18, 2020 20:59
Enable copy 500px images and image links by right click at the image
// ==UserScript==
// @name copy 500px images
// @namespace http://www.oldcai.com/
// @version 0.1
// @description copy 500px images
// @author You
// @match https://500px.com/photo/*
// @grant none
// ==/UserScript==
@oldcai
oldcai / manage.py
Created September 17, 2016 17:09 — forked from rhblind/manage.py
Django manage.py and runserver command for use with gevent-socketio
#!/usr/bin/env python
import os
import sys
from gevent import monkey
from psycogreen.gevent import patch_psycopg
# The threading module raises a KeyError if already loaded
# when monkey patching it.
if "threading" in sys.modules:
@oldcai
oldcai / all-mount
Last active September 14, 2018 08:47
KoolShare Merlin boot start /jffs/scripts/ files
#!/bin/sh
/jffs/scripts/xunlei stop
/jffs/scripts/swap stop
/jffs/scripts/remount start
/jffs/scripts/swap start
/jffs/scripts/xunlei start
@oldcai
oldcai / ss-install.md
Created December 20, 2015 14:41 — forked from aa65535/ss-install.md
shadowsocks-libev install at Debian or CentOS

Debian

cd /tmp
# 下载源码
git clone https://github.com/madeye/shadowsocks-libev.git
# 开始编译
cd shadowsocks-libev
./autogen.sh
./configure --prefix=/usr && make
make install
@oldcai
oldcai / shadowsocks.service
Created August 22, 2015 01:35
Shadowsocks systemd.service config file
[Unit]
Description=Great Shadowsocks Server
Wants=network-online.target
After=network.target
[Service]
Type=simple
PIDFile=/run/shadowsocks.pid
ExecStart=/usr/local/bin/ss-server -c /etc/sysconfig/shadowsocks
@oldcai
oldcai / remap.xml
Last active August 29, 2015 14:17
Use Karabiner to remap key pad to keyboard 利用Karabiner将小键盘映射成标准键盘按键 http://www.oldcai.com/archives/1029
<?xml version="1.0"?>
<root>
<item>
<name>Change KeyPad 0 to Num 0</name>
<identifier>private.change_keypad0_to_num0</identifier>
<autogen>__KeyToKey__ KeyCode::KEYPAD_0, KeyCode::KEY_0</autogen>
</item>
<item>
<name>Change KeyPad 1 to Num 1</name>
<identifier>private.change_keypad1_to_num1</identifier>