Skip to content

Instantly share code, notes, and snippets.

@aaronwz0
aaronwz0 / llm-wiki.md
Created May 2, 2026 16:08 — 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.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jQuery QQ登陆框效果 ab蓝学网 http://www.ablanxue.com</title>
<link href="css/login.css" rel="stylesheet" />
<script src="js/jquery-1.9.1.min.js" type="text/javascript"></script>
<script src="js/jquery.login.js" type="text/javascript"></script>
</head>
<body>
@aaronwz0
aaronwz0 / PHP--图片裁剪、缩放函数
Last active December 28, 2015 15:59
PHP图片裁剪、缩放函数 根据自定义的目标图高宽, 按目标图高宽比裁剪、缩放源图. 传入参数: $source_path string 源图路径 $target_width integer 目标图宽度 $target_height integer 目标图高度 源图支持MIMETYPE: image/gif, image/jpeg, image/png.
<?php
function imagecropper($source_path, $target_width, $target_height)
{
$source_info = getimagesize($source_path);
$source_width = $source_info[0];
$source_height = $source_info[1];
$source_mime = $source_info['mime'];
$source_ratio = $source_height / $source_width;
$target_ratio = $target_height / $target_width;