How ipiton/agent-memory-mcp works
agent-memory-mcp is an engineering-context service for AI agents: MCP clients use its tools to capture and retrieve typed memory, search indexed project documents, inspect allowed repository files, and maintain knowledge across sessions. The principal workflow enters through the MCP server, dispatches tool requests to memory, RAG, or repository-search capabilities, and returns ranked or structured results; session-close analysis and stewardship add consolidation and review stages. README documents both stdio and HTTP transports and the major features. Some internal routing is unsampled, so those links are shown as unverified rather than asserted as inspected calls.
Main entry points: server.go MCP server · memory.go Typed memory · vectorservice.go Hybrid retrieval · sessionclose.go Session consolidation
Components 25
MCP entry and tools
- MCP server
internal/server/server.go - Engineering tools
internal/server/tools_engineering.go - Repo file tools
internal/search/search.go
Memory lifecycle
- Typed memory
internal/memory/memory.go - Session consolidation
internal/sessionclose/sessionclose.go - Session extraction
internal/sessionclose/extract.go - Review resolution
internal/review/resolve.go - Project bank views
internal/memory/projectbank_views.go
Search and retrieval
- Document RAG
internal/rag/rag.go - Document indexer
internal/rag/indexer.go - Hybrid retrieval
internal/rag/vectorservice.go
Capture and stewardship
- Session hooks
internal/hooks/event.go - Capture deduplication
internal/hooks/dedup.go - Knowledge stewardship
internal/steward/steward.go - Drift scanner
internal/steward/scanner.go - Archive sweep
internal/lifecycle/archive_sweep.go
Storage and providers
- Vector index
internal/vectorstore/vectorstore.go - Keyword ranking
internal/vectorstore/keyword.go - Embedding providers
internal/embedder/embedder.go - Neural reranker
internal/reranker/reranker.go - Path allowlist
internal/paths/paths.go - SQLite
internal/dbutil/sqlite.go
Other components
- MCP client
- CLI
cmd/agent-memory-mcp/main.go - Engineering user
Connections 27
- MCP client → MCP server: sends requests
README.md - Engineering user → CLI: runs commands
README.md - CLI → MCP server: starts service
cmd/agent-memory-mcp/main.go - MCP server → Engineering tools: dispatches tools
- MCP server → Typed memory: uses memory
internal/server/server.go - MCP server → Document RAG: uses retrieval
internal/server/server.go - MCP server → Repo file tools: offers repo search
- Engineering tools → Typed memory: stores knowledge
internal/server/tools_engineering.go - Engineering user → Repo file tools: searches files
README.md - Repo file tools → Path allowlist: checks allowed paths
internal/search/search.go - Document RAG → Document indexer: indexes documents
- Document RAG → Hybrid retrieval: retrieves candidates
- Hybrid retrieval → Vector index: queries index
internal/rag/vectorservice.go - Hybrid retrieval → Embedding providers: embeds queries
- Hybrid retrieval → Neural reranker: reranks results
internal/rag/vectorservice.go - Vector index → Keyword ranking: maintains keywords
internal/vectorstore/vectorstore.go - Vector index → SQLite: persists chunks
internal/vectorstore/vectorstore.go - Typed memory → SQLite: persists memories
- Session hooks → Capture deduplication: filters captures
- Session consolidation → Session extraction: extracts knowledge
- Session consolidation → Typed memory: consolidates records
internal/sessionclose/sessionclose.go - Session consolidation → Review resolution: queues review
- Knowledge stewardship → Drift scanner: runs scans
internal/steward/steward.go - Drift scanner → Typed memory: checks memories
internal/steward/scanner.go - Archive sweep → Typed memory: updates lifecycle
internal/lifecycle/archive_sweep.go - MCP server → Knowledge stewardship: provides maintenance
- MCP server → Project bank views: serves bank views