How akitaonrails/ai-memory works
ai-memory is a cross-agent, cross-machine long-term memory system for coding agents. Its central workflow captures sanitized lifecycle observations, consolidates session activity into a git-backed Markdown wiki, then supplies bounded briefs and search to later sessions; typed handoffs let agents pass work explicitly. The graph also preserves documented management, SDK, import, and optional LLM capabilities. Some subsystem wiring is documented only at product level, so those edges cite the README rather than implying unsampled call paths.
Main entry points: ai-memory-cli/src CLI and server · ai-memory-hooks/src Lifecycle capture · ai-memory-consolidate/src Session consolidation · ai-memory-wiki/src Markdown wiki
Components 13
Capture and sessions
- Lifecycle capture
crates/ai-memory-hooks/src - CLI and server
crates/ai-memory-cli/src
Memory processing
- Session consolidation
crates/ai-memory-consolidate/src - Markdown wiki
crates/ai-memory-wiki/src - Search index
crates/ai-memory-store/src
Access interfaces
- MCP services
crates/ai-memory-mcp/src - Management console
crates/ai-memory-web/src/management
Clients and integrations
- LLM providers
crates/ai-memory-llm/src - TypeScript SDK
companions/ai-memory-ts/src/client.ts - Memory importer
companions/ai-memory-importer/src/main.rs - Desktop manager
companions/ai-memory-macos/Sources/AIMemoryMenu/AppModel.swift
Other components
- Coding agents
- People and operators
Connections 15
- Coding agents → Lifecycle capture: emit observations
- Lifecycle capture → CLI and server: submit capture
- CLI and server → Session consolidation: consolidate sessions
- Session consolidation → Markdown wiki: write pages
- Markdown wiki → Search index: derive index
- Coding agents → CLI and server: request brief and search
- CLI and server → Search index: retrieve memories
- Coding agents → MCP services: connect through MCP
- Coding agents → CLI and server: pass handoffs
- CLI and server → LLM providers: rewrite optionally
- People and operators → Management console: administer memory
- People and operators → CLI and server: import prior memory
- People and operators → Desktop manager: manage server
companions/ai-memory-macos/Sources/AIMemoryMenu/AppModel.swift - Coding agents → TypeScript SDK: use client API
companions/ai-memory-ts/src/client.ts - TypeScript SDK → MCP services: invoke MCP tools
companions/ai-memory-ts/src/client.ts