[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-1216":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":35,"readmeContent":36,"aiSummary":37,"trendingCount":16,"starSnapshotCount":16,"syncStatus":38,"lastSyncTime":39,"discoverSource":40},1216,"cavemem","JuliusBrussee\u002Fcavemem","JuliusBrussee","Cross-agent persistent memory for coding assistants. Stored compressed. Retrieved fast. Local by default.","https:\u002F\u002Fgetcaveman.dev\u002F",null,"TypeScript",518,46,1,25,0,20,47,171,60,99.02,"MIT License",false,"main",true,[27,28,29,30,31,32,33,34],"ai","caveman","claude","claude-code","compress","memory","rag","rag-chatbot","2026-06-12 04:00:08","\u003Cdiv align=\"center\">\n\n![](https:\u002F\u002Fem-content.zobj.net\u002Fsource\u002Fapple\u002F391\u002Frock_1faa8.png)\n\n# cavemem\n\n**why agent forget when agent can remember**\n\n[![npm](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002Fcavemem?style=flat&color=yellow)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fcavemem) [![Stars](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002FJuliusBrussee\u002Fcavemem?style=flat&color=yellow)](https:\u002F\u002Fgithub.com\u002FJuliusBrussee\u002Fcavemem\u002Fstargazers) [![Last Commit](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flast-commit\u002FJuliusBrussee\u002Fcavemem?style=flat)](https:\u002F\u002Fgithub.com\u002FJuliusBrussee\u002Fcavemem\u002Fcommits\u002Fmain) [![License](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002FJuliusBrussee\u002Fcavemem?style=flat)](LICENSE)\n\n[Install](#install) • [How it works](#how-it-works) • [CLI](#cli) • [MCP](#mcp) • [Settings](#settings)\n\n\u003C\u002Fdiv>\n\n\u003Cp align=\"center\">\n  \u003Cstrong>🪨 Caveman Ecosystem\u003C\u002Fstrong> &nbsp;·&nbsp;\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FJuliusBrussee\u002Fcaveman\">caveman\u003C\u002Fa> \u003Cem>talk less\u003C\u002Fem> &nbsp;·&nbsp;\n  \u003Cstrong>cavemem\u003C\u002Fstrong> \u003Cem>remember more\u003C\u002Fem> \u003Csub>(you are here)\u003C\u002Fsub> &nbsp;·&nbsp;\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FJuliusBrussee\u002Fcavekit\">cavekit\u003C\u002Fa> \u003Cem>build better\u003C\u002Fem>\n\u003C\u002Fp>\n\n\n---\n\nCross-agent persistent memory for coding assistants. Hooks fire at session boundaries, compress observations with the caveman grammar (~75% fewer prose tokens, code and paths preserved byte-for-byte), and write to local SQLite. Agents query their own history through three MCP tools. No network. No cloud.\n\n**Supports:** Claude Code · Cursor · Gemini CLI · OpenCode · Codex\n\n- **Persistent memory across sessions.** Hooks capture what happened; the store keeps it.\n- **Compressed at rest.** Deterministic caveman grammar, round-trip-guaranteed expansion for humans.\n- **Progressive MCP retrieval.** `search`, `timeline`, `get_observations` — agents filter before fetching.\n- **Hybrid search.** SQLite FTS5 keyword + local vector index, combined with a tunable ranker.\n- **Local by default.** No network calls. Optional remote embedding providers via config.\n- **Web viewer.** Read-only UI at `http:\u002F\u002Flocalhost:37777` for browsing sessions in human-readable form.\n- **Cross-IDE installers.** Claude Code, Gemini CLI, OpenCode, Codex, Cursor — one command each.\n- **Privacy-aware.** `\u003Cprivate>...\u003C\u002Fprivate>` stripped at write boundary. Path globs exclude whole directories.\n\n---\n\n## Install\n\n```sh\nnpm install -g cavemem\ncavemem install                    # Claude Code\ncavemem install --ide cursor       # cursor | gemini-cli | opencode | codex\ncavemem status                     # see wiring + embedding backfill\ncavemem viewer                     # open http:\u002F\u002F127.0.0.1:37777\n```\n\nNo daemon to start. Hooks write synchronously. A local worker auto-spawns in the background on the first hook to build embeddings; it self-exits when idle. Disable with `cavemem config set embedding.autoStart false`.\n\n---\n\n## How it works\n\n```\nsession event  →  redact \u003Cprivate>  →  compress  →  SQLite + FTS5\n                                                           ↑\n                                                MCP queries on demand\n```\n\nWhat compression looks like in practice:\n\n```\nInput:  \"The auth middleware throws a 401 when the session token expires; we should add a refresh path.\"\nStored: \"auth mw throws 401 @ session token expires. add refresh path.\"\nViewed: \"The auth middleware throws a 401 when session token expires. Add refresh path.\"\n```\n\nCode blocks, URLs, paths, identifiers, and version numbers are never touched. Hook handlers complete in under 150ms. Full bodies fetched on demand via `get_observations`.\n\n---\n\n## CLI\n\n| Command | |\n|---------|--|\n| `cavemem install [--ide \u003Cname>]` | Register hooks + MCP for an IDE |\n| `cavemem uninstall [--ide \u003Cname>]` | Remove hooks + MCP |\n| `cavemem status` | Single dashboard: wiring, DB counts, embedding backfill, worker pid |\n| `cavemem config show\\|get\\|set\\|open` | View\u002Fedit settings — schema is self-documenting |\n| `cavemem start\\|stop\\|restart` | Control the worker daemon (usually unnecessary — auto-starts) |\n| `cavemem viewer` | Open the memory viewer in your browser |\n| `cavemem doctor` | Verify installation |\n| `cavemem search \u003Cquery> [--limit N] [--no-semantic]` | Search memory (BM25 + cosine re-rank) |\n| `cavemem compress \u003Cfile>` | Compress a file with caveman grammar |\n| `cavemem reindex` | Rebuild FTS5 + vector index |\n| `cavemem export \u003Cout.jsonl>` | Dump observations to JSONL |\n| `cavemem mcp` | Start MCP server (stdio) |\n\n---\n\n## MCP\n\nProgressive disclosure: `search` and `timeline` return compact results; `get_observations` fetches full bodies.\n\n| Tool | Returns |\n|------|---------|\n| `search(query, limit?)` | `[{id, score, snippet, session_id, ts}]` — BM25 + optional cosine re-rank |\n| `timeline(session_id, around_id?, limit?)` | `[{id, kind, ts}]` |\n| `get_observations(ids[], expand?)` | Full bodies, expanded by default |\n| `list_sessions(limit?)` | `[{id, ide, cwd, started_at, ended_at}]` |\n\n---\n\n## Settings\n\n`~\u002F.cavemem\u002Fsettings.json`\n\n| Key | Default | |\n|-----|---------|--|\n| `dataDir` | `\"~\u002F.cavemem\"` | SQLite location |\n| `compression.intensity` | `\"full\"` | `lite` \u002F `full` \u002F `ultra` |\n| `compression.expandForModel` | `false` | Return expanded text to model |\n| `embedding.provider` | `\"local\"` | `local` \u002F `ollama` \u002F `openai` |\n| `workerPort` | `37777` | Local viewer port |\n| `search.alpha` | `0.5` | BM25 \u002F vector blend |\n| `search.defaultLimit` | `10` | Default result count |\n| `privacy.excludePatterns` | `[]` | Paths never captured |\n\nContent inside `\u003Cprivate>...\u003C\u002Fprivate>` is stripped before write. Paths matching `excludePatterns` are never read. The worker binds to `127.0.0.1` only.\n\n---\n\n## 🪨 The Caveman Ecosystem\n\nThree tools. One philosophy: **agent do more with less**.\n\n| Repo | What | One-liner |\n|------|------|-----------|\n| [**caveman**](https:\u002F\u002Fgithub.com\u002FJuliusBrussee\u002Fcaveman) | Output compression skill | *why use many token when few do trick* — ~75% fewer output tokens across Claude Code, Cursor, Gemini, Codex |\n| [**cavemem**](https:\u002F\u002Fgithub.com\u002FJuliusBrussee\u002Fcavemem) *(you are here)* | Cross-agent persistent memory | *why agent forget when agent can remember* — compressed SQLite + MCP, local by default |\n| [**cavekit**](https:\u002F\u002Fgithub.com\u002FJuliusBrussee\u002Fcavekit) | Spec-driven autonomous build loop | *why agent guess when agent can know* — natural language → kits → parallel build → verified |\n\nThey compose: **cavekit** orchestrates the build, **caveman** compresses what the agent *says*, **cavemem** compresses what the agent *remembers*. Install one, some, or all — each stands alone.\n\n## Also by Julius Brussee\n\n- [**Revu**](https:\u002F\u002Fgithub.com\u002FJuliusBrussee\u002Frevu-swift) — local-first macOS study app with FSRS spaced repetition. [revu.cards](https:\u002F\u002Frevu.cards)\n\n## License\n\nMIT\n","cavemem 是一个为编码助手设计的跨代理持久化内存解决方案。它通过在会话边界触发钩子来捕获并压缩数据，使用自定义的caveman语法将观测值压缩约75%，同时保持代码和路径的完整性，并存储于本地SQLite数据库中。该项目支持多种编码环境如Claude Code、Cursor等，并提供包括搜索、时间线浏览在内的三种MCP工具帮助代理查询历史记录。其特点还包括基于FTS5的关键字与向量索引结合的混合搜索方式、默认本地运行以确保隐私安全以及提供Web界面便于用户查看会话内容。非常适合需要提高开发效率且注重数据隐私保护的场景使用。",2,"2026-06-11 02:42:22","CREATED_QUERY"]