How taimufuraiyaa/agent-memory works
agent-memory is a persistent memory layer for coding agents, with local-first and hosted interfaces. The principal local workflow registers a workspace, accepts memory writes, and returns ranked, token-budgeted recall for an agent. Its domain stages include hybrid persistence, retrieval and context assembly; additional documented capabilities include graph expansion, exact-term search, and agent integrations. The tree and excerpts also show a hosted API and worker/reconciliation services. Some hosted modules are unsampled, so their internal connections are represented only where the API entry point or documentation supports them.
Main entry points: write_pipeline.go Write pipeline · main.go Hosted API · commands.go CLI commands · recall.go Recall service
Components 22
Local workspace
- CLI commands
internal/cli/commands.go - Workspace manager
internal/workspace/manager.go - Local HTTP API
internal/api/server.go - Recall endpoint
internal/api/recall_pipeline.go
Memory engine
- Write pipeline
internal/engine/write_pipeline.go - Recall service
internal/application/recall.go - Hybrid retrieval
internal/engine/retrieval.go - Context assembly
internal/engine/recall_assembly.go - Graph expansion
internal/engine/knowledge_graph.go - Exact-term search
internal/application/term_search.go - SQLite memory store
internal/storage/sqlite/store.go - Markdown tier
internal/storage/markdown/adapter.go - Embedding provider
internal/embeddings/provider.go
Hosted service
- Hosted API
cmd/agent-memory-api/main.go - Tenant memory
internal/saas/memory/service.go - Hosted retrieval
internal/saas/retrieval/service.go - Source ingestion
internal/saas/source/upload.go - Background worker
cmd/agent-memory-worker/main.go - Reconciliation
cmd/agent-memory-reconciler/main.go
Agent interfaces
- Agent integrations
internal/integration/registry.go - Dashboard
tools/agent-memory/dashboard/src/main.tsx
Other components
- Coding agent
Connections 24
- Coding agent → CLI commands: invokes
README.md - CLI commands → Workspace manager: manages workspaces
- Workspace manager → SQLite memory store: opens databases
internal/workspace/manager.go - Coding agent → Local HTTP API: requests memory
- Local HTTP API → Recall endpoint: routes recall
- Recall endpoint → Recall service: calls recall
internal/api/recall_pipeline.go - Recall service → Hybrid retrieval: retrieves candidates
- Hybrid retrieval → SQLite memory store: reads memories
- Recall service → Context assembly: assembles context
- Coding agent → CLI commands: writes memories
- CLI commands → Write pipeline: submits writes
- Write pipeline → SQLite memory store: persists entries
internal/engine/write_pipeline.go - Write pipeline → Embedding provider: eagerly embeds
internal/engine/write_pipeline.go - Write pipeline → Markdown tier: supports tier hook
- Hybrid retrieval → Graph expansion: expands relations
- Coding agent → Exact-term search: searches terms
- Coding agent → Agent integrations: connects through
README.md - Coding agent → Dashboard: uses dashboard
README.md - Coding agent → Hosted API: uses hosted service
- Hosted API → Tenant memory: configures service
cmd/agent-memory-api/main.go - Hosted API → Hosted retrieval: configures search
cmd/agent-memory-api/main.go - Hosted API → Source ingestion: configures uploads
cmd/agent-memory-api/main.go - Background worker → Source ingestion: processes sources
cmd/agent-memory-worker/main.go - Reconciliation → Source ingestion: reconciles vault
cmd/agent-memory-reconciler/main.go