Skip to content

Instantly share code, notes, and snippets.

@nansystem
nansystem / llm-wiki.md
Created April 25, 2026 02:49 — 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.

[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
# default value
# 127.0.0.1 localhost
# ::1 localhost
# 1. WSL2 の IP を取得(最初の1つだけ)
$wsl_ip = wsl sh -c "hostname -I | cut -d' ' -f1" | Out-String | ForEach-Object {
$_.Trim()
}
@nansystem
nansystem / pre-commit
Last active January 12, 2025 06:36
Git Hook Script for Credential Scanning with Secretlint (Windows-Compatible)
#!/bin/bash
source "$(dirname "$0")/_local-hook-exec"
declare FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g')
[ -z "$FILES" ] && exit 0
echo " ▶ Checking for credentials using secretlint..."
declare TEMPDIR=$(mktemp -d)
trap 'rm -rf -- "$TEMPDIR"' EXIT
# Secretlint all staged files
@nansystem
nansystem / my.cnf
Last active August 14, 2021 02:28
MySQLのmy.cnfの設定内容を理解する
[mysqld]
server-id=1
# https://gist.github.com/fevangelou/fb72f36bbe333e059b66
datadir = /var/lib/mysql
# よく使われるログの種類
# ログの種類  ログの内容
# error サーバーから出力されるエラーメッセージ
# slow query 処理に時間のかかったクエリ
@nansystem
nansystem / gist:181a4d06f87aebe5aa7e405871297ed2
Last active December 16, 2017 10:58
prerequisites docker-scraping
https://github.com/akirakoyasu/docker-scraping
docker-compose run --rm scraping app/scraping/by_chromedriver.py
-- Prerequisites
-- install docker in ubuntu14.04
-- https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/#supported-storage-drivers
-- https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/#install-docker-ce