{"id":49457049,"url":"https://github.com/jholhewres/anchored","last_synced_at":"2026-06-12T01:01:40.693Z","repository":{"id":354796511,"uuid":"1225193156","full_name":"jholhewres/anchored","owner":"jholhewres","description":"Persistent cross-tool memory for AI coding agents. Single binary. Zero dependencies.","archived":false,"fork":false,"pushed_at":"2026-06-06T16:01:40.000Z","size":722,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-06-06T17:22:15.628Z","etag":null,"topics":["ai","claude-code","cli","cursor","developer-tools","golang","knowledge-graph","local-first","mcp","memory"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jholhewres.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-30T03:22:14.000Z","updated_at":"2026-06-06T16:01:44.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jholhewres/anchored","commit_stats":null,"previous_names":["jholhewres/anchored"],"tags_count":47,"template":false,"template_full_name":null,"purl":"pkg:github/jholhewres/anchored","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jholhewres%2Fanchored","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jholhewres%2Fanchored/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jholhewres%2Fanchored/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jholhewres%2Fanchored/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jholhewres","download_url":"https://codeload.github.com/jholhewres/anchored/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jholhewres%2Fanchored/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34224103,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","claude-code","cli","cursor","developer-tools","golang","knowledge-graph","local-first","mcp","memory"],"created_at":"2026-04-30T07:03:05.877Z","updated_at":"2026-06-12T01:01:40.685Z","avatar_url":"https://github.com/jholhewres.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Anchored\n\n\u003e Persistent cross-tool memory for AI coding agents. Local-first, single binary, zero dependencies.\n\n[![License: MIT](https://img.shields.io/badge/license-MIT-green?style=for-the-badge)](LICENSE)\n[![Go](https://img.shields.io/badge/go-1.25+-00ADD8?style=for-the-badge\u0026logo=go)]\n[![Release](https://img.shields.io/github/v/release/jholhewres/anchored?style=for-the-badge)](https://github.com/jholhewres/anchored/releases)\n\nAnchored gives Claude Code, Cursor, OpenCode, Gemini CLI, Codex, VS Code Copilot, and other MCP-compatible tools one shared memory database on your machine.\n\n- Local-first: no account, no cloud dependency, no required API key.\n- One binary: `anchored` is both the CLI and MCP server.\n- Fast retrieval: SQLite FTS5 + local ONNX embeddings + knowledge graph.\n- Safe lifecycle: memories are scored, curated, inspected, exported, forgotten, and synced with privacy filters.\n\nFor team-shared project memory, the optional self-hosted/server side lives in [`anchored_oss`](../anchored_oss). Local Anchored remains the source of truth and the hot retrieval path.\n\n## What Anchored remembers\n\nAnchored stores small durable memories, not raw chat dumps by default. The public categories stay intentionally simple:\n\n| Category | Use for |\n|---|---|\n| `fact` | Stable truths about a user, project, team, stack, API, or system. |\n| `preference` | Personal preferences, project conventions, or team rules. Preferences have `user`/`project`/`team` scope. |\n| `decision` | Architecture, tooling, naming, process, or product decisions. |\n| `event` | Time-bound events: deploys, meetings, incidents, releases. |\n| `learning` | Non-obvious lessons, gotchas, root causes, post-mortems. |\n| `plan` | Intent, backlog, next steps, TODOs. |\n| `summary` | Handoffs, recaps, precompact snapshots, daily/project summaries. |\n\nBehind those categories, Anchored stores lifecycle metadata (`memory_type`, `kind`, `scope`, `origin`, `importance`, `confidence`, `expires_at`, `context_tier`, `curation_status`) so search, context injection, retention, curation, and remote sync make consistent decisions without making the MCP API harder for agents to use.\n\n## Core features\n\n- **Cross-tool memory** — all supported agents read/write the same local memory store.\n- **Hybrid search** — RRF fusion of BM25, local multilingual embeddings, entity detection, project boost, topic diversity, and lifecycle scoring.\n- **Knowledge graph** — pattern-based and explicit subject/predicate/object relationships, scoped by project.\n- **Memory stack** — `anchored_context` returns identity, project stats, recent durable knowledge, and recent important session events under a tight budget.\n- **Curated lifecycle** — default-on background curation scores recent memories in small batches and marks low-signal entries without deleting anything.\n- **Dream review** — explicit/manual duplicate and contradiction analysis. Dedup can soft-delete; contradictions require manual review.\n- **Privacy-first sync** — remote preview/sync block local paths, secrets, personal preferences, episodic/operational data, and low-quality memories by default.\n- **Sandbox and indexing tools** — run code, process files, fetch docs, and index large output without flooding the model context.\n- **Inspection and export** — inspect exact metadata, list memories, export JSON/JSONL, restore curation backups, and purge safely.\n- **Multi-source import** — Claude Code JSONL, OpenCode SQLite, Cursor `.mdc`, and DevClaw.\n\n## Install\n\nFrom GitHub Releases:\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/jholhewres/anchored/main/install/install.sh | bash\n```\n\nFrom source:\n\n```bash\ngit clone https://github.com/jholhewres/anchored.git\ncd anchored\nmake build\nsudo cp bin/anchored /usr/local/bin/\n```\n\nFirst run creates `~/.anchored/` and downloads the local embedding model when needed (~470 MB).\n\n## Setup\n\n### Claude Code plugin\n\nThe plugin is the easiest path because it installs MCP registration, slash commands, hooks, and the auto-trigger skill together:\n\n```text\n/plugin marketplace add jholhewres/anchored\n/plugin install anchored@anchored\n```\n\nRestart Claude Code after installation. Available slash commands include `/anchored:context`, `/anchored:search`, `/anchored:save`, `/anchored:stats`, `/anchored:doctor`, and `/anchored:purge`.\n\n\u003e **Running context-mode too?** Anchored now ships its own PreToolUse routing —\n\u003e it steers Read/Grep/Glob/Bash/WebFetch and subagents toward memory and the\n\u003e sandbox tools, the same mechanism context-mode uses. Running both plugins\n\u003e means two routing blocks competing for the model's attention, and\n\u003e context-mode's redirects can shadow Anchored's. Uninstall context-mode for the\n\u003e cleanest behavior — Anchored covers both the memory and the context-window\n\u003e story on its own.\n\n### MCP only\n\n```bash\nclaude mcp add -s user anchored anchored\n```\n\nThe `-s user` flag makes Anchored available in every project. Without it, Claude Code registers the server only for the current project.\n\n### Other tools\n\nRun auto-detection:\n\n```bash\nanchored init\n```\n\nOr target one tool:\n\n```bash\nanchored init --tool cursor\nanchored init --tool opencode\nanchored init --tool gemini\nanchored init --tool agy\nanchored init --tool windsurf\nanchored init --tool cline\nanchored init --tool vscode --cwd /path/to/project\nanchored init --tool codex\nanchored init --tool devin\n```\n\nSupported config locations:\n\n| Tool | Config file |\n|---|---|\n| Claude Code | `~/.claude.json` |\n| Cursor | `~/.cursor/mcp.json` |\n| OpenCode | `~/.config/opencode/opencode.json` |\n| Gemini CLI | `~/.gemini/settings.json` |\n| Antigravity 2.0 | `~/.gemini/config/mcp_config.json` |\n| Antigravity CLI (`agy`) | `~/.gemini/antigravity-cli/mcp_config.json` |\n| Windsurf | `~/.codeium/windsurf/mcp_config.json` |\n| Cline | `~/.cline/mcp.json` |\n| VS Code Copilot | `.vscode/mcp.json` |\n| Codex CLI | `~/.codex/config.toml` |\n| Devin | `.devin/config.json` |\n\nMost tools use this JSON shape:\n\n```json\n{\n  \"mcpServers\": {\n    \"anchored\": {\n      \"command\": \"anchored\"\n    }\n  }\n}\n```\n\nVS Code Copilot uses `servers` and requires `type: \"stdio\"`:\n\n```json\n{\n  \"servers\": {\n    \"anchored\": {\n      \"type\": \"stdio\",\n      \"command\": \"anchored\"\n    }\n  }\n}\n```\n\nCodex CLI uses TOML:\n\n```toml\n[mcp_servers.anchored]\ncommand = \"anchored\"\nenabled = true\n```\n\n## CLI overview\n\n```text\nanchored                         Start MCP server over STDIO\nanchored serve                   Start MCP server over STDIO\nanchored init [--tool]           Register Anchored with supported tools\nanchored doctor [--cwd]          Diagnose binary, model, DB, and MCP registration\nanchored stats                   Show memory counts and import status\n\nanchored save \u003ccontent\u003e          Save a memory\nanchored search \u003cquery\u003e          Search memories\nanchored list                    List memories\nanchored inspect \u003cid\u003e            Show full JSON metadata\nanchored update \u003cid\u003e             Revise a memory in place\nanchored forget \u003cid\u003e             Soft-delete a memory; --hard for permanent delete\nanchored export                  Export memories as JSON/JSONL\n\nanchored curation status         Show background curation worker state\nanchored curation enable         Enable serve-time curation worker\nanchored curation disable        Disable serve-time curation worker\nanchored curation score          Score and optionally mark low-signal memories\nanchored curation clean          Soft-delete or hard-delete low-signal memories\nanchored curation restore        Restore a DB backup made before curation cleanup\n\nanchored dream                   Analyze duplicate/contradictory memories\nanchored dream --apply \u003cid\u003e      Apply one proposed dream action\nanchored retention sweep         Archive expired operational/episodic memories\nanchored bootstrap [--cwd]       Extract project seed memories from README/docs/rules/tree\nanchored handoff [--scope]       Save a short session handoff with TTL\nanchored precompact              Save a pre-compaction recovery snapshot\nanchored hook \u003csubcommand\u003e       Run session continuity hooks\n\nanchored remote status           Show remote sync configuration\nanchored remote configure        Configure a remote server\nanchored remote link|unlink      Link/unlink remote project IDs\nanchored remote preview          Offline preview of syncable/blocked memories\nanchored remote sync             Push syncable memories and KG triples\nanchored purge                   Wipe memories; --hard resets DB with backup\n```\n\nImport sources: `claude-code`, `devclaw`, `opencode`, `cursor`, `all`.\n\n## Curation vs dream\n\nAnchored has two maintenance paths because they solve different problems:\n\n| Path | Default | What it does | Safety model |\n|---|---:|---|---|\n| `curation` | On | Scores recent memories in small batches, sets `importance`, and marks `low_signal`. | Non-destructive. No content rewrites or deletes. |\n| `dream` | Manual | Finds duplicates, merge/supersede opportunities, and contradictions. | Proposed actions; destructive operations require explicit apply/review. |\n\nThe curation worker starts with `anchored serve`. By default it runs every 15 minutes, processes newest candidates first, and updates at most 50 memories per pass. Tune or disable it with:\n\n```bash\nanchored curation status\nanchored curation disable\nanchored curation enable\nanchored config set curation.interval_minutes 5\nanchored config set curation.max_updates_per_run 25\nanchored config set curation.threshold 0.55\n```\n\nUse `anchored curation clean --dry-run` when you want to remove low-signal memories. Cleanup is never automatic.\n\n## MCP tools\n\n### Memory tools\n\n| Tool | Purpose |\n|---|---|\n| `anchored_context` | First call in a conversation; loads identity, project snapshot, recent durable memory. |\n| `anchored_search` | Hybrid memory search, project-aware and remote-capable. |\n| `anchored_save` | Save fact/preference/decision/event/learning/plan/summary memories. |\n| `anchored_update` | Revise an existing memory instead of duplicating it. |\n| `anchored_forget` | Soft-delete or hard-delete a memory. |\n| `anchored_list` | List memories by category/project/time. |\n| `anchored_stats` | Show memory statistics. |\n| `anchored_session_end` | Close a tracked session and optionally save a summary. |\n| `anchored_kg_query` | Query entity relationships from the knowledge graph. |\n| `anchored_kg_add` | Add a relationship such as `repo — uses → Postgres`. |\n\n### Sandbox and indexing tools\n\n| Tool | Purpose |\n|---|---|\n| `anchored_execute` | Run code in a sandboxed subprocess; stdout only enters context. |\n| `anchored_execute_file` | Process one file with injected `FILE_PATH`/`FILE_CONTENT`. |\n| `anchored_batch_execute` | Run multiple commands, index large output, and search it in one call. |\n| `anchored_index` | Index local markdown/prose into the sandbox FTS corpus. |\n| `anchored_ctx_search` | Search the indexed sandbox corpus. |\n| `anchored_fetch_and_index` | Fetch URL → markdown → index, with cache and batch support. |\n\n## How it works\n\n1. **Project detection** maps a working directory to a stable project record. Git remotes derive a cross-machine `remote_key` without leaking local paths.\n2. **Memory save** sanitizes content, auto-categorizes when needed, attaches lifecycle metadata, stores SQLite/FTS rows, embeds asynchronously, and extracts KG triples when possible.\n3. **Search** combines BM25, vector similarity, query expansion, entity boost, project boost, topic diversity, and lifecycle scoring.\n4. **Context** renders a bounded XML-like bundle with identity, project stats, recent durable memories, and important recent session events.\n5. **Curation** incrementally improves metadata quality so bad memories are demoted and sync filters can block them.\n6. **Dream/retention** provide explicit deeper cleanup and lifecycle archiving.\n7. **Remote sync** replicates project/team-safe semantic memories and KG triples when configured; local remains complete without remote.\n\n## Storage\n\n```text\n~/.anchored/\n├── config.yaml\n├── debug.log                  # optional, only when debug.enabled=true\n└── data/\n    ├── anchored.db            # SQLite: memories, FTS5, vector cache, KG, sessions\n    ├── bkps/                  # backups made by purge/restore/curation flows\n    └── onnx/                  # local embedding model and ONNX runtime\n```\n\nNo ports are opened. There is no always-on system daemon; the MCP server runs while the client keeps the `anchored` process alive.\n\n## Configuration examples\n\n```yaml\ncuration:\n  enabled: true\n  interval_minutes: 15\n  threshold: 0.55\n  max_updates_per_run: 50\n\nsanitizer:\n  enabled: true\n  patterns:\n    - 'ACME_[A-Z0-9]{32}'\n\ncontext_optimizer:\n  enabled: false\n```\n\nShow or edit config:\n\n```bash\nanchored config show\nanchored config set curation.enabled false\nanchored config wizard\n```\n\n## Development\n\n```bash\nmake build\nmake test\n./bin/anchored serve\n```\n\nBefore a release, bump `VERSION`, run `make sync-version`, update `CHANGELOG.md`, then tag `vX.Y.Z`.\n\n## Docs\n\n- [Design](docs/design.md) — memory stack, hybrid search, knowledge graph, quantization.\n- [Architecture](docs/architecture.md) — project structure and implementation details.\n- [Embedding Model](docs/embedding-model.md) — model choice, quantization, inference pipeline.\n- [Import Sources](docs/import-sources.md) — supported importers and parsing behavior.\n- [MCP Protocol](docs/mcp-protocol.md) — tool schemas and protocol reference.\n- [Team Sync](docs/team-sync.md) — local + remote architecture for shared project memory.\n- [Improvements Roadmap](docs/improvements-roadmap.md) — local-first roadmap before/alongside team sync.\n- [Memory Lifecycle](docs/memory-lifecycle-roadmap.md) — lifecycle classification, scoring, retention, and curation.\n- [Changelog](CHANGELOG.md) — version history.\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjholhewres%2Fanchored","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjholhewres%2Fanchored","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjholhewres%2Fanchored/lists"}