Skip to content

Instantly share code, notes, and snippets.

@nanha
nanha / llm-wiki.md
Created April 6, 2026 00:22 — 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.

@nanha
nanha / App.tsx
Created November 20, 2020 09:42 — forked from kotarella1110/App.tsx
Counter app example - TypeScript + React + Redux + redux-saga
import * as React from 'react';
import { Store, createStore, combineReducers, applyMiddleware } from 'redux';
import createSagaMiddleware from 'redux-saga';
import * as ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { reducer as counter, rootSaga } from './counter';
import Counter from './Counter';
const sagaMiddleware = createSagaMiddleware();
# you have ctags but it does not work...
$ ctags -R --exclude=.git --exclude=log *
ctags: illegal option -- R
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
#you need to get new ctags, i recommend homebrew but anything will work
$ brew install ctags
#alias ctags if you used homebrew
$ alias ctags="`brew --prefix`/bin/ctags"
#!/bin/sh
# Credentials for a MySQL user with PROCESS, SUPER permissions
USERNAME=
PASSWORD=
# MySQL Server location
HOST=127.0.0.1
PORT=3306
@nanha
nanha / dea.yml
Created May 19, 2013 03:52 — forked from conmame/dea.yml
---
deployment:
name: "dea"
domain: "hoge.com" #使用するドメイン
jobs:
install:
- stager
- dea:
local_route: "192.168.249.44" #自分の環境に合わせる (この設定ファイルが置かれるDEAのIPアドレス)
@nanha
nanha / gist:3129007
Created July 17, 2012 11:54 — forked from ishiduca/gist:2280639
node.js http.agent の agent.maxSockets の上限を避ける その2
var events,http, url, path;
events = require('events');
http = require('http');
url = require('url');
path = require('path');
var agents = {};
agent.onSocketsLengthChange;
if (http.getAgent) {
@nanha
nanha / clickify.js
Created July 8, 2012 12:29 — forked from maxweisel/clickify.js
collect.js - use clean urls with Backbone History / Router
(function($){
// Declare the rootUrl used for filtering internal links.
var rootUrl = document.location.protocol + '//' + (document.location.hostname || document.location.host) + (document.location.port ? ':' + document.location.port : '') + '/';
// Helper functions
var getFragment = function(url, root) { // Grab the fragment and format it how Backbone expects
var fragment = url;
if (fragment.indexOf(':') !== -1)
fragment = fragment.replace(/.*:\/\/[^\/]+/, '');
if (!fragment.indexOf(root)) fragment = fragment.substr(root.length);
@nanha
nanha / hello-node.js
Created July 7, 2012 02:06 — forked from nf/hello-node.js
Hello world web server that scales across multiple processors
var cluster = require('cluster');
var http = require('http');
var numCPUs = require('os').cpus().length;
if (cluster.isMaster) {
// Fork workers.
for (var i = 0; i < numCPUs; i++) {
cluster.fork();
}
cluster.on('exit', function(worker, code, signal) {
@nanha
nanha / hello-spdy3.js
Created July 4, 2012 02:59 — forked from shigeki/hello-spdy3.js
Hello SPDY by Node-0.7.x
var tls = require('tls');
var fs = require('fs');
var zlib = require('zlib');
var events = require('events');
var util = require('util');
var dictionary = require('./dict.js').dictionary;
var word = '<!DOCTYPE html><html><head><title>Hello SPDY</title></head><body>Hello SPDY</body></html>';
function parseNV_HeaderBlock(buffer) {
var nv = [];
@nanha
nanha / bespin.vim
Created July 4, 2012 02:22 — forked from acoffman/bespin.vim
vim colorscheme based on mozilla bespin
" Vim color file
" Converted from Textmate theme Bespin using Coloration v0.2.5 (http://github.com/sickill/coloration)
set background=dark
highlight clear
if exists("syntax_on")
syntax reset
endif