📖 Docs · GitHub · ScopeLab · WikiDemo · Changelog · Issues
Core LLM Wiki is a family of cross-platform TypeScript packages for long-term LLM memory, built on SQLite. It turns raw conversation logs and documents into a structured knowledge base of facts, tasks and graph edges, with fact extraction, semantic search and memory pruning. It runs wherever your app runs: Expo, React Native, the browser, or Node.js.
Inspired by Andrej Karpathy's LLM Wiki memory spec. Supports Open Knowledge Format (OKF) v0.2 import and export.
📖 Full documentation: equationalapplications.github.io/expo-llm-wiki. It has quickstarts, guides, recipes and the complete API reference.
- Bring your own inference. You provide one
generateTextfunction. The library builds the prompts, parses the JSON and writes to the database. Works with OpenAI, Gemini, Claude or a local model. Steer the librarian withprompts.guidance; see the prompts guide. - Just SQLite. Facts, vectors and graph edges live in prefixed tables (
llm_wiki_by default) in your own database. No vector database, no Neo4j. - Offline first. Keyword search runs in-process. Semantic search turns on when you provide
embed()and falls back to keyword search when the network is down. - GraphRAG built in. Optional seeded ontologies make the model emit typed edges, and
traverseGraph()walks them with a single recursive SQL query. - Multi-entity. Many independent "brains" in one database, with weighted reads across them.
- Trust and provenance. Document facts are protected from rewriting, unreviewed facts can be held as drafts, and opt-in grounding checks that facts quote their source. Ops librarian facts can carry a source pointer: the event each fact came from and, when grounding permits, the verified quote. The quote survives the event's prune and travels with the fact through export and the outbox — and a quote carries whatever its event carried, so secrets stay out of events as they already must out of fact bodies. Remove a quote today by forgetting its fact —
forget({ entryId })drops it from reads and exports immediately and prune purges the row; per-event deletion isforget({ eventId })(#386). When the librarian merges new event text into an existing fact, the fact'sderived_eventslist records those events too (events the model attributed), andforget({ eventId })matches it. - No silent failures. An optional
onDiagnostichook reports what would otherwise be dropped, with typed, content-free reports.
Pick the package for your platform:
# Expo / React Native
npx expo install expo-sqlite expo-crypto
npm install @equationalapplications/expo-llm-wiki
# React (web)
npm install @equationalapplications/react-llm-wiki sql.js
# Node.js or any other JavaScript runtime
npm install @equationalapplications/core-llm-wiki better-sqlite3 # or sql.jsUse npx expo install for the Expo packages so Expo picks native builds that match your SDK. expo-llm-wiki wires up expo-crypto for you, so Hermes needs no crypto polyfill. core-llm-wiki and react-llm-wiki require Node.js 20 or later.
Then, three lines to memory:
import { formatContext } from '@equationalapplications/core-llm-wiki'; // also exported by the expo and react packages
await wiki.write('user-123', { event_type: 'observation', summary: 'Loves hiking on weekends.' });
const memory = await wiki.read('user-123', 'what should we do on Saturday?');
const context = formatContext(memory); // → paste into your system promptFollow the quickstart for your platform to create wiki: Expo · React · Node.js
| Package | Purpose | Docs |
|---|---|---|
@equationalapplications/core-llm-wiki |
The memory engine. Any SQLite driver, any platform. | core |
@equationalapplications/expo-llm-wiki |
Core plus expo-sqlite, expo-crypto and React hooks |
expo |
@equationalapplications/react-llm-wiki |
React hooks and provider for web apps | react |
@equationalapplications/core-llm-tools |
Gemini tool schemas and a capability-scoped injector | core-llm-tools |
@equationalapplications/core-okf |
Zero-dependency OKF v0.1 and v0.2 primitives | core-okf |
@equationalapplications/schema-org-llm-wiki |
Curated schema.org ontology manifest (data only) | ontologies |
@equationalapplications/schema-software-org |
Software-organization ontology manifest (data only) | ontologies |
@equationalapplications/prisma-outbox |
Sync SQLite outbox events to a Prisma database | guide |
@equationalapplications/mcp-server |
MCP server giving coding agents hosted cloud memory | mcp-server |
Not sure which one you need? See Choose a package.
- WikiDemo exercises every
react-llm-wikihook in the browser. - ScopeLab is a client-side playground for
core-llm-toolsscopes and memory.
Both run on sql.js with no backend. You bring your own LLM key.
- How memory works · Retrieval · GraphRAG · API reference
- Security, including the prompt-injection trust boundary and GDPR deletion. To report a vulnerability, see SECURITY.md.
- Contributing · Changelog
- Benchmarks
- Roadmap
Built on Core LLM Wiki:
- Curated Thoughts: a privacy-first desktop second brain (Tauri, React, Rust) with a built-in MCP server.
- Curated Thoughts Integrations: wires Curated Thoughts into Claude Code, OpenCode, Hermes, and other agent harnesses. A software agency in a box.
- Curated Journal: a fully offline Expo journal, and the reference app for
expo-llm-wiki. - The hosted cloud service: cloud memory on the same engine. Its MCP server is
@equationalapplications/mcp-server.
MIT
Made with ❤️ by Equational Applications LLC. https://equationalapplications.com/