https://github.com/7xuanlu/origin
Local-first AI work memory that compounds: capture decisions, lessons, gotchas in flow, distill into source-backed wiki pages, recall across sessions and any MCP client (Claude Code, Codex, etc...). Plain Markdown you own.
https://github.com/7xuanlu/origin
agent-memory ai-agents ai-memory claude claude-code claude-code-plugin codex cursor daemon git knowledge-graph llm-memory llm-wiki local-first long-term-memory mcp mcp-server memory model-context-protocol rust
Last synced: 4 days ago
JSON representation
Local-first AI work memory that compounds: capture decisions, lessons, gotchas in flow, distill into source-backed wiki pages, recall across sessions and any MCP client (Claude Code, Codex, etc...). Plain Markdown you own.
- Host: GitHub
- URL: https://github.com/7xuanlu/origin
- Owner: 7xuanlu
- License: apache-2.0
- Created: 2026-04-19T22:07:06.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2026-06-08T01:37:31.000Z (4 days ago)
- Last Synced: 2026-06-08T03:20:38.539Z (4 days ago)
- Topics: agent-memory, ai-agents, ai-memory, claude, claude-code, claude-code-plugin, codex, cursor, daemon, git, knowledge-graph, llm-memory, llm-wiki, local-first, long-term-memory, mcp, mcp-server, memory, model-context-protocol, rust
- Language: Rust
- Homepage: https://useorigin.app
- Size: 67.1 MB
- Stars: 41
- Watchers: 0
- Forks: 3
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
- Agents: AGENTS.md
Awesome Lists containing this project
README
[](https://github.com/7xuanlu/origin/actions/workflows/ci.yml?query=branch%3Amain)
[](https://github.com/7xuanlu/origin/releases/latest)
[](https://www.npmjs.com/package/@7xuanlu/origin)
[](https://www.npmjs.com/package/origin-mcp)
[](https://modelcontextprotocol.io)
[](#license)
**Your next AI session should pick up the context you built, not lose it in chat history.**
Origin is the single local home for your AI work artifacts: decisions, lessons, gotchas, project context. Captured in flow, distilled into source-backed wiki pages, recalled across chats, projects, and time.
A brief opens each session, a handoff closes it, so the thread carries forward instead of restarting.
One store, every tool: Claude Code, Cursor, Codex, Claude Desktop, VS Code, and Gemini CLI query the same local daemon. Read the Markdown under `~/.origin/`, or symlink it into Obsidian for a graph view. Spaces keep work, personal, and client projects from bleeding together.
[](https://youtu.be/k37gjWVPHwI)
---
## What makes Origin distinct
1. **Compounds, not just storage.** Most memory tools hand back snippets. Origin clusters captures into source-backed wiki pages, and those pages feed retrieval alongside the atomic memories they came from.
2. **One home, locked to none.** Every MCP client queries the same local daemon, so context built in one tool shows up in the next. Obsidian is one optional view you can symlink in, not where your work lives.
3. **Review before trust.** Low-confidence captures and contradictions surface for review instead of silently entering context. Correct yourself once and Origin supersedes the old fact instead of serving both. Pages cite their source memory IDs, and the daemon refuses unsourced pages rather than letting hallucinated summaries in.
4. **Real git versioning.** Memory, page, and session writes commit into `~/.origin/.git/`, so you can inspect, diff, revert, or branch the Markdown artifacts.
```text
a1b2c3d page: embedding-retrieval refreshed (4 sources)
9f8e7d6 session: handoff embedding-work
5a4b3c2 capture: decision mem_abc123
```
---
## Quickstart
### Claude Code in 30 seconds
```text
/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 `, or `/handoff` inside Claude Code.
Plugin details and daily commands: [plugin/](plugin/.claude-plugin/README.md).
### 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.
```bash
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:
```bash
npx -y @7xuanlu/origin setup
```
Then start with `~/.origin/bin/origin status`, `~/.origin/bin/origin recall `, or `~/.origin/bin/origin store `. CLI details: [crates/origin-cli](crates/origin-cli/README.md).
---
## How Origin works
The same loop runs every session: capture while you work, let the daemon refine between sessions, and return with the knowledge already in context.
```text
┌──────── loops back · /handoff closes each pass ─────────┐
▼ │
┌─────┴─────┐ ┌─────────────┐ ┌────────────────┐ ┌─────┴─────┐
│ CAPTURE │ │ DAEMON │ │ ONE STORE │ │ RECALL + │
│ in flow │ ─▶ │ refines │ ─▶ │ (local) │ ─▶ │ BRIEF │
│ /capture │ │ between │ │ · memories │ │ next │
│ │ │ sessions │ │ · wiki pages │ │ session │
│ │ │ dedup·link │ │ · graph │ │ /recall │
│ │ │ /distill │ │ │ │ /brief │
└───────────┘ └─────────────┘ └────────────────┘ └───────────┘
one local daemon · one store · every MCP client reads it
Claude Code · Cursor · Codex · Claude Desktop · VS Code · Gemini
```
Each pass leaves the store sharper. Captures that would sit as loose snippets elsewhere get deduped, linked to the people and projects they touch, and distilled into source-citing pages, so the next session brings back knowledge, not raw history. That is the compounding the loop is named for.
These five verbs drive it:
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 ` saves a decision, lesson, gotcha, or project fact in flow. `/recall ` 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 back in the Claude Code plugin; MCP-only clients call the `context` tool for the same memory. Recall pulls the relevant slice, not your whole history, so the context window goes to the work.
Full skill reference: [plugin/skills](plugin/skills/README.md).
Works fully local with no API key, cloud account, or signup. Capture, recall, hybrid search, and graph context need nothing external; add a local model or API key only for automatic page distillation. No telemetry.
---
## 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, vector embeddings, and graph context in one local store your MCP clients can query, fused with reciprocal-rank fusion. An optional local cross-encoder reranker sharpens the top results.
- **Connected recall**: people, projects, tools, and decisions come back linked, so a memory arrives with the context around it instead of alone.
- **Distill cycles**: run `/distill` manually today, or add a local model/API key for background extraction, page refreshes, recaps, and richer graph links.
- **Stays fresh on its own**: background passes link entities, grow matching pages, and update each memory's effective confidence from type, access, and age, so recent and load-bearing memories surface while stale ones fade.
- **Review before trust**: low-confidence captures, pending revisions, contradictions, and supersessions 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.
- **You own the data**: everything is plain Markdown under `~/.origin/`, versioned in git. Grep it, symlink it into Obsidian, or walk away with the files anytime. No lock-in.
### Spaces
Memories belong to a **space** like `origin`, `career`, or
`ideas`. Set the active space 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; local BGE-Reranker-V2-M3 cross-encoder rerank is the latest shipped path when enabled. The table below is retrieval-only, not end-to-end answer quality. ~168 tokens per recall query. Eval harness at [`crates/origin-core/src/eval/`](crates/origin-core/src/eval/). Run it yourself.
Update workflow in [docs/eval](docs/eval/README.md).
| Benchmark | Recall@5 | MRR | NDCG@10 |
|---|---:|---:|---:|
| LongMemEval (oracle, 500 Q) | 93.6% | 0.857 | 0.883 |
| LoCoMo (locomo10) | 70.0% | 0.647 | 0.684 |
---
## 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](crates/origin-core/README.md) | Storage, search, embeddings, distill cycles, graph, pages, export, eval. |
| [crates/origin-server](crates/origin-server/README.md) | Local daemon and HTTP API. |
| [crates/origin-mcp](crates/origin-mcp/README.md) | MCP server, tools, npm package. |
| [crates/origin-cli](crates/origin-cli/README.md) | User CLI for setup, service management, search, recall, store, list, agents, model/key setup, and doctor. |
| [plugin/](plugin/.claude-plugin/README.md) | Claude Code plugin (`plugin.json`, skills, hooks, `.mcp.json`). |
| [docs/eval](docs/eval/README.md) | Benchmark workflow and methodology. |
Full contributor map: [CLAUDE.md](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:
```bash
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](AGENTS.md#cross-platform).
---
## Learn more
Longer-form writing on AI work memory and how Origin compares lives at [useorigin.app/learn](https://useorigin.app/learn):
**Concepts**
- [What is AI work memory?](https://useorigin.app/learn/ai-work-memory): the shape of the problem Origin solves
- [MCP memory server](https://useorigin.app/learn/mcp-memory-server): how Origin exposes memory through the Model Context Protocol
- [Local-first AI memory](https://useorigin.app/learn/local-first-ai-memory): data, privacy, and control
- [Markdown + local index](https://useorigin.app/learn/markdown-local-index-ai-memory): the storage model
- [AI agent handoff loop](https://useorigin.app/learn/ai-agent-handoff-loop): session-end discipline that prevents context loss
**Comparisons**
- [Origin vs Basic Memory](https://useorigin.app/learn/origin-vs-basic-memory): Markdown knowledge base vs AI work-session memory
- [Origin vs claude-mem](https://useorigin.app/learn/origin-vs-claude-mem): observer-style Claude Code memory vs MCP-first cross-tool memory
- [Origin vs Superlocal Memory](https://useorigin.app/learn/origin-vs-superlocal-memory): includes the honest LoCoMo benchmark concession
**Docs**
- [Get started](https://useorigin.app/docs/get-started): install + verify the first local memory loop
- [Daily workflow](https://useorigin.app/docs/daily-workflow): capture, handoff, distill
- [MCP clients](https://useorigin.app/docs/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](https://github.com/danielmiessler/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](https://github.com/rohitg00/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](CONTRIBUTING.md). Architecture and development rules are in [CLAUDE.md](CLAUDE.md). Security reports: [SECURITY.md](SECURITY.md). Please also read the [Code of Conduct](CODE_OF_CONDUCT.md).
---
## 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](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f). Raw-to-wiki distillation pattern.
- Claude Code's `MEMORY.md`. The simplest version of the idea.
Peers:
- [agentmemory](https://github.com/rohitg00/agentmemory). Agent-side memory framework.
- [basic-memory](https://github.com/basicmachines-co/basic-memory). Local-first knowledge management for Claude.
- [obsidian-mind](https://github.com/breferrari/obsidian-mind). Obsidian-native memory and review loop for coding agents.
- [pro-workflow](https://github.com/rohitg00/pro-workflow). Claude Code productivity suite.
- [mcp-memory-service](https://github.com/doobidoo/mcp-memory-service). Memory service for MCP.
- [Memoria](https://github.com/matrixorigin/Memoria). "Git for AI Agent Memory" via Copy-on-Write.
- [OpenMemory](https://github.com/CaviraOSS/OpenMemory), [claude-memory-compiler](https://github.com/coleam00/claude-memory-compiler), [PAI](https://github.com/danielmiessler/PAI), Palinode. Adjacent shapes.
Different shapes of the same problem. Try the one that fits.