How songf0140/auto-memories-doll works
Auto-Memories-Doll is a local-first memory companion: it captures conversations, turns them into topic-organized Markdown knowledge, then retrieves relevant memories for later AI chats. The main loop runs from chat or external ingestion through retrieval/response or candidate creation, audit, and durable storage; derived indexes support recall. The README documents the larger audit and nightly-governance capabilities. Some of those implementations were not sampled, so those links are documented at subsystem level rather than asserting unverified internal calls.
Main entry points: handler.ts Chat handler · orchestrator.ts Write orchestrator · audit Audit pipeline · (main) Web interface
Components 21
User experience
- Web interface
src/app/(main) - Chat UI
src/components/chat - Memory library
src/components/memory - Audit panel
src/components/audit
Chat and capture
- Chat API
src/app/api/chat - Chat handler
src/features/chat/handler.ts - AI providers
src/lib/ai - Conversation intake
src/app/api/listen/route.ts - Ingest processing
src/features/ingest
Memory and retrieval
- Memory service
src/server/services/memory-service.ts - Search and ranking
src/lib/vector - Knowledge graph
src/lib/graph
Audit and governance
- Audit pipeline
src/features/audit - Write orchestrator
src/server/services/orchestrator.ts - Nightly governance
src/server/orchestrators/nightly-orchestrator.ts
Storage and integrations
- Markdown knowledge
src/lib/storage - SQLite state
src/lib/storage/database.ts - File watcher
src/server/watchers/file-watcher.ts - Configuration
src/server/services/config-service.ts - MCP tools
src/lib/mcp/manager.ts
Other components
- User
Connections 26
- User → Web interface: uses
- Web interface → Chat UI: renders
- Chat UI → Chat API: sends chat
src/components/chat/useChatSession.ts - Chat API → Chat handler: dispatches
src/app/api/chat/route.ts - Chat handler → Search and ranking: searches memories
src/features/chat/handler.ts - Chat handler → AI providers: requests response
src/features/chat/handler.ts - AI providers → Chat handler: streams response
src/features/chat/handler.ts - User → Conversation intake: pushes conversations
- Conversation intake → Ingest processing: processes input
src/app/api/listen/route.ts - Ingest processing → Write orchestrator: stages candidates
- Chat handler → Write orchestrator: queues candidates
- Write orchestrator → Audit pipeline: checks candidates
- Audit panel → Audit pipeline: reviews events
- Audit pipeline → Write orchestrator: approves writes
- Write orchestrator → Markdown knowledge: writes notes
- Write orchestrator → SQLite state: records queue
- Memory service → SQLite state: stores records
src/server/services/memory-service.ts - Memory service → Search and ranking: updates vectors
src/server/services/memory-service.ts - Search and ranking → Knowledge graph: expands related
- Markdown knowledge → File watcher: triggers import
src/server/watchers/file-watcher.ts - File watcher → Memory service: imports changes
src/server/watchers/file-watcher.ts - Nightly governance → Audit pipeline: reports findings
- Nightly governance → Markdown knowledge: compiles summaries
- Configuration → SQLite state: persists settings
src/server/services/config-service.ts - Chat handler → MCP tools: invokes tools
src/features/chat/handler.ts - Web interface → Memory library: browses memories