Skip to content

About

Offline-first, SQLite-backed, tiered, multi-entity memory for LLM apps built with Expo, React, Node, or plain JS

Resources

Contributing

Security policy

Stars

31 stars

Watchers

0 watching

Forks

Latest commit

 

History

3,314 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

expo-llm-wiki

GitHub Tag TypeScript License: MIT

npm version npm downloads
npm version npm downloads
npm version npm downloads
npm version npm downloads
npm version npm downloads
npm version npm downloads
npm version npm downloads
npm version npm downloads

📖 Docs · GitHub · ScopeLab · WikiDemo · Changelog · Issues

Persistent, episodic memory for AI agents

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.

Why Core LLM Wiki?

  • Bring your own inference. You provide one generateText function. 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 with prompts.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 is forget({ eventId }) (#386). When the librarian merges new event text into an existing fact, the fact's derived_events list records those events too (events the model attributed), and forget({ eventId }) matches it.
  • No silent failures. An optional onDiagnostic hook reports what would otherwise be dropped, with typed, content-free reports.

Quick start

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.js

Use 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 prompt

Follow the quickstart for your platform to create wiki: Expo · React · Node.js

Packages

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.

Live demos

  • WikiDemo exercises every react-llm-wiki hook in the browser.
  • ScopeLab is a client-side playground for core-llm-tools scopes and memory.

Both run on sql.js with no backend. You bring your own LLM key.

More documentation

Ecosystem

Built on Core LLM Wiki:

License

MIT


Made with ❤️ by Equational Applications LLC. https://equationalapplications.com/

About

Offline-first, SQLite-backed, tiered, multi-entity memory for LLM apps built with Expo, React, Node, or plain JS

Resources

Contributing

Security policy

Stars

31 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages