Skip to content

Instantly share code, notes, and snippets.

@mokeyish
mokeyish / llm-wiki.md
Created May 20, 2026 13:30 — 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.

@mokeyish
mokeyish / hooks.ts
Last active August 12, 2022 09:29
Register Jsx.Directives automaticly.
import { onCleanup } from "solid-js"
type Hook = {
destroy?: () => void
}
type FnArgs<T extends (...args: any) => any> = () => Parameters<T> extends { length: 1 } ? true : SkipFirst<Parameters<T>, 1>
export default function solidWrap<F extends (el: Element, ...args: any[]) => Hook | void>(fn: F): (el: Element, args: FnArgs<F>) => void {
return (el: Element, accessor?: FnArgs<F>) => {
#!/usr/bin/env -S deno run --allow-run
/**
###################################################################
#Script Name : lddc
#Description : collect all deps path of file.
#Args : -q : print deps path only.
#Author : YISH
#Email : mokeyish@hotmail.com
###################################################################
@mokeyish
mokeyish / SouceGraph.js
Created March 5, 2020 05:14
SouceGraph inject TamperMonkey Script
// ==UserScript==
// @name SourceGraph
// @namespace https://github.com/mokeyish
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://github.com/*
// @grant none
// ==/UserScript==
pub trait HashCode {
fn get_hash_code(&self) -> u64;
}
impl<T: std::hash::Hash> HashCode for T {
fn get_hash_code(&self) -> u64 {
use std::hash::Hasher;
use std::collections::hash_map::DefaultHasher;
let mut s = DefaultHasher::new();
self.hash(&mut s);
@mokeyish
mokeyish / aria2.conf
Created March 3, 2018 14:57
aria2 settings
## 下载设置 ##
# 断点续传
continue=true
# 最大同时下载任务数, 运行时可修改, 默认:5
max-concurrent-downloads=5
# 单个任务最大线程数, 添加时可指定, 默认:5
split=16