Skip to content

7xuanlu/origin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

294 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Origin: Where AI work compounds. Decisions, lessons, project context, and wiki pages.

CI Release npm: @7xuanlu/origin npm: origin-mcp MCP Server License

macOS Linux Windows

Claude Code OpenAI Codex Cursor VS Code Claude Desktop Gemini CLI Obsidian

Your next AI session should pick up the context you built, not lose it in chat history.

Origin gives your daily AI workflow one local home: memory your agents can recall, wiki pages you can read, and source-backed context that captures, distills, and versions decisions, lessons, and project context across chats, projects, and time.

Your agent reads searchable memory, graph context, and hybrid retrieval. You read Markdown artifacts under ~/.origin/. Same store, two surfaces.

Watch the Origin demo


What makes Origin distinct

  1. Composition, not just storage. Memories distill into pages. Sessions track workflow. An entity graph links people, projects, tools, and relations. Recall pulls vector hits, FTS hits, and graph neighbors together. Keyword search alone misses the connections. ~30 MCP tools across one daemon, not 100+ skills bolted on.
  2. Real git versioning. Every memory write is a git commit in ~/.origin/.git/. Inspect with git log. Revert with git checkout. Branch and blame as needed.
 $ cd ~/.origin && git log --oneline -5
 a1b2c3d page: embedding-retrieval refreshed (4 sources)
 9f8e7d6 session: handoff embedding-work
 5a4b3c2 capture: fact mem_def456
 8d7c6b5 capture: decision mem_abc123
 3e2f1a0 init: origin v0.6.1
  1. Mandatory, refreshable provenance. Wiki pages cite source memory IDs. The daemon rejects pages with empty source_memory_ids (HTTP 422). Pages aren't write-once: each carries stale_reasons and revision_state. /distill re-runs and background cycles refresh them as new memories arrive, without losing the citation chain.
 $ curl -X POST http://127.0.0.1:7878/pages \
     -d '{"title":"X","content":"Y","source_memory_ids":[]}'
 HTTP/1.1 422 Unprocessable Entity
 {"error":"source_memory_ids cannot be empty"}
  1. Auditable memory. Low-confidence captures and contradictions surface for review when they happen, instead of silently entering context. Supersession chains and protected-memory conflicts stay visible. Audit when you want, trust the defaults when you don't.

Quickstart

Claude Code in 30 seconds

/plugin marketplace add 7xuanlu/origin
/plugin install origin@7xuanlu
/init

If Claude Code asks for a restart after installing, restart once, then run /init. The plugin handles daemon setup, MCP wiring, local memory setup, and the first round-trip check.

Then try /brief, /capture <decision>, or /handoff inside Claude Code.

Plugin details and daily commands: plugin/.

MCP-only setup

Use this if you want Origin tools in Claude Code without the plugin, or in Codex, Cursor, Claude Desktop, VS Code, or Gemini CLI.

npx -y @7xuanlu/origin setup
~/.origin/bin/origin mcp add claude-code      # or: codex, cursor, claude-desktop, vscode, gemini

MCP-only gives agents tools for capture, recall, context, doctor, and page distillation. It does not install Claude Code slash skills like /brief, /handoff, /distill, or /init.

Terminal runtime setup

Set up the local Origin runtime:

npx -y @7xuanlu/origin setup

Then start with ~/.origin/bin/origin status, ~/.origin/bin/origin recall <query>, or ~/.origin/bin/origin store <text>. CLI details: crates/origin-cli.


How Origin works

Origin follows the rhythm of an AI work session, with five verbs you use directly:

  1. Session starts. /brief [topic] loads project status, identity, preferences, and topic-relevant memories so the agent walks in with context.
  2. During work. /capture <thing> saves a decision, lesson, gotcha, or project fact in flow. /recall <query> looks anything up.
  3. Session ends. /handoff writes what changed, what's still open, and where to continue, so the next run picks up cleanly.
  4. Between sessions. The daemon deduplicates overlapping captures and links related ideas in the background. /distill synthesizes wiki pages from clusters of related memories when you want a deliberate pass.
  5. Next session. /brief brings it all back in the Claude Code plugin. MCP-only clients call the context tool for the same underlying memory without replaying full chat history.

Full skill reference: plugin/skills.

No cloud sync or telemetry by default. Local models and Anthropic keys are opt-in for automatic distill cycles.


What you get

  • Atomic memory layer: every capture is stored first as a typed memory with source agent, confidence, stability, and supersession metadata.
  • Source-backed pages: pages keep source memory IDs, stale reasons, and revision state so distillation can refresh them without losing provenance.
  • Hybrid retrieval on libSQL: memories, pages, FTS5 text search, vector embeddings, and graph context live in one local store your MCP clients can query.
  • Knowledge graph context: people, projects, tools, observations, and relations become retrievable context instead of isolated notes.
  • Distill cycles: run /distill manually today, or add a local model/API key for background extraction, page refreshes, recaps, and richer graph links.
  • Background enrichment and decay: post-ingest passes link entities, enrich titles, grow matching pages, and update effective confidence based on memory type, access, and age.
  • Review before trust: low-confidence captures, pending revisions, protected-memory conflicts, contradictions, and supersession chains can surface instead of silently entering context.
  • Explicit spaces: tag memories, pages, and recalls with space=work | personal | client-X so a day-job capture never bleeds into a side-project brief. Auto-detected from the current repo or workspace when no space is set; overridable always.
  • Local artifacts: Markdown pages live in ~/.origin/pages/, session logs and project status live under ~/.origin/sessions/, and ~/.origin/ keeps local git history you can inspect, revert, or symlink into Obsidian.

Multi-bucket workflows

Memories belong to a space — a bucket like origin, career, or ideas. Set the active bucket per shell:

ORIGIN_SPACE=career claude

Or declaratively via ~/.origin/spaces.toml (see plugin/examples/spaces.toml). To manage spaces from the CLI:

origin space list
origin space add ideas --default
origin space show ideas
origin space move scratch career

origin doctor prints the current resolver state so you can see exactly which layer chose the active space.


Evaluation

Hybrid retrieval, transparent eval. BGE-Base-EN-v1.5-Q + FTS5 + Reciprocal Rank Fusion. Recall@5 = 88% on LongMemEval (oracle, 500 Q), 67% on LoCoMo. ~168 tokens per recall query. Eval harness at crates/origin-core/src/eval/. Run it yourself.

Update workflow in docs/eval.

Benchmark Recall@5 MRR NDCG@10
LongMemEval (oracle, 500 Q) 88.0% 74.2% 79.0%
LoCoMo (locomo10) 67.3% 58.9% 64.0%

Repo Map

Origin is daemon-first. origin-server owns the local database, embeddings, distill cycles, knowledge graph, and HTTP API on 127.0.0.1:7878. The plugin, MCP server, CLI, and local tools are thin clients over that daemon.

Path What lives there
crates/origin-core Storage, search, embeddings, distill cycles, graph, pages, export, eval.
crates/origin-server Local daemon and HTTP API.
crates/origin-mcp MCP server, tools, npm package.
crates/origin-cli User CLI for setup, service management, search, recall, store, list, agents, model/key setup, and doctor.
plugin/ Claude Code plugin (plugin.json, skills, hooks, .mcp.json).
docs/eval Benchmark workflow and methodology.

Full contributor map: CLAUDE.md.


Build from source

Origin builds natively on macOS (Apple Silicon + Intel), Linux (x86_64 + ARM64; glibc), and Windows (x86_64). The npm wrapper (@7xuanlu/origin, origin-mcp) and install.sh auto-detect your platform and pull the matching prebuilt release. Most users should install through the Claude Code plugin or npx. For local development:

git clone https://github.com/7xuanlu/origin.git
cd origin
cargo build --workspace
cargo run -p origin-server

Build details for the daemon, MCP server, CLI, and core crates live in the crate READMEs linked above. Cross-platform specifics (service registration, paths, Windows install limitation) live in AGENTS.md.


Learn more

Longer-form writing on AI work memory and how Origin compares lives at useorigin.app/learn:

Concepts

Comparisons

Docs

  • Get started — install + verify the first local memory loop
  • Daily workflow — capture, handoff, distill
  • MCP clients — connect Claude Code, Cursor, Codex, Claude Desktop, Gemini CLI

What Origin is NOT

  • Not a Life OS. No habits, calendar, journal, or life-management modules. Origin scopes to AI work artifacts only. If you want a full personal OS, look at PAI.
  • Not a workflow suite. ~30 MCP tools across one daemon. If you want 30+ skills, 8+ agents, and an auto-research loop bundled, look at pro-workflow. Origin trades breadth for focus.
  • Not a memory infrastructure SDK. For people using AI daily, not as a backend for other apps building memory features.
  • Not for one-off chats. Best when work spans sessions, projects, and weeks.

Contributing

Bug fixes, eval cases, docs, and features are welcome. Start with CONTRIBUTING.md. Architecture and development rules are in CLAUDE.md. Security reports: SECURITY.md. Please also read the Code of Conduct.


License

Origin is licensed under Apache-2.0. This includes the local runtime, CLI, MCP server, shared types, and Claude Code plugin files in this repo.

The permissive license keeps the daemon boundary usable for MCP clients and downstream local tools.


Acknowledgments

Predecessors:

  • Karpathy's LLM-wiki note. Raw-to-wiki distillation pattern.
  • Claude Code's MEMORY.md. The simplest version of the idea.

Peers:

Different shapes of the same problem. Try the one that fits.

Packages

 
 
 

Contributors

Languages