Skip to content

Instantly share code, notes, and snippets.

View SimonCqk's full-sized avatar
🎯
Focusing

Simon_CQK SimonCqk

🎯
Focusing
  • Nvidia
  • Hangzhou
View GitHub Profile
@SimonCqk
SimonCqk / llm-wiki.md
Created April 23, 2026 07: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.

@SimonCqk
SimonCqk / BPlusTree.py
Last active February 8, 2018 06:52
A B Plus Tree implementation of pure python 3.
"""
This file include the concrete implementation of B+ tree.
"""
import bisect
import math
import operator
from abc import abstractmethod, ABCMeta
from typing import Iterable
@SimonCqk
SimonCqk / ConcurrentQueue.hpp
Last active January 19, 2018 12:49
A lock-free concurrent queue implementation of C++.
#ifndef _CONCURRENT_QUEUE_IMPL_HPP
#define _CONCURRENT_QUEUE_IMPL_HPP
#include<iostream>
#include<array>
#include<chrono>
#include<thread>
#include<atomic>
#include<condition_variable>
#include<mutex>
@SimonCqk
SimonCqk / btree.py
Last active March 22, 2023 05:47 — forked from teepark/btree.py
a pure-python B tree and B+ tree implementation
import bisect
import itertools
import operator
class _BNode(object):
__slots__ = ["tree", "contents", "children"]
def __init__(self, tree, contents=None, children=None):
self.tree = tree