manymems
Team memory for multi-session, multi-modal agentic coding agents.
This project extends claude-mem — a persistent memory plugin for AI coding tools — into a shared memory system for engineering teams. Two capabilities drive the work:
- Intent → Code Provenance. Link every developer prompt to the exact lines it changed, anchored by tree-sitter symbols so the link survives later edits. Ask "why was this written?" and get the original intent back.
- Team multi-session memory. Let Claude Code, Cursor, Codex, Windsurf, and other agents share a common memory pool with identity, privacy controls, conflict detection, multi-modal capture, and team-scoped retrieval.
Why this project exists
AI coding agents remember nothing across sessions and share nothing across teammates. Each developer rediscovers the same patterns, re-explains the same context, and loses the reasoning behind every change the moment the session ends.
claude-mem solves the single-developer case. manymems solves the team case.
What claude-mem already provides
Developer prompt
│
▼
UserPromptSubmit hook
│ stores prompt_text in user_prompts table
▼
PostToolUse hook ──► observation handler
│ │
│ ▼
│ Claude Agent SDK
│ (compresses tool events
│ into structured observations)
│ │
▼ ▼
SQLite ◄────────── storeObservation()
(local) files_modified: [paths] ← paths only, no line ranges
│
▼
Chroma (vectors)
│
▼
SessionStart hook
injects relevant past observations
into the next session's context
The team server (Postgres + BullMQ + better-auth, merged in PR #2383) adds multi-user identity, API-key auth, and a horizontally scalable worker. The substrate is sound; the gaps are provenance and team-layer features.
What manymems adds
Track A — Intent → Code Provenance
User types a prompt
│
▼ (UserPromptSubmit)
user_prompts row ──── prompt_id ────────────────────────┐
│
│ │
▼ (PostToolUse: Edit / Write) │
A1: extract line ranges │
│ new_string found in file after edit │
│ line_start, line_end computed deterministically │
▼ │
A2: build symbol anchor (tree-sitter) │
│ qualified_name: "AuthService.login" │
│ signature_hash: sha256(signature) ← staleness │
▼ │
A3: code_provenance row ◄─────────────── prompt_id ───────┘
│ file_path, line_start, line_end
│ symbol_qualified_name, signature_hash
│ old_content_hash, new_content_hash
│ commit_sha (backfilled by A4)
▼
A4: git post-commit hook
│ fills commit_sha on matching rows
▼
A5: get_code_provenance MCP tool
│ input: file, line
│ output: [{prompt_text, symbol, line_range,
│ commit_sha, stale}]
▼
"why was this written?" answered
Staleness: when a query arrives, manymems re-hashes the symbol's current signature. If it differs from the stored signature_hash, the record returns stale: true.
Track B — Team Multi-Session Memory