How sreenav14/memoire works
Memoire turns uploaded documents and saved chats into evidence-grounded, evolving memory, then answers questions with citations. Users enter through the React UI; authentication and space management are handled by the Auth API, while the Memory API exposes chat, search, document, note, profile, and inference-rule operations. Background jobs extract and chunk content, build a knowledge graph, consolidate facts, and apply inference rules. Query retrieval combines vector recall, graph expansion, and evidence packing. The README documents the service-level flow; unsampled router and retrieval implementations are represented by their documented responsibilities.
Main entry points: worker.py Job worker · app/main.py Memory API app · auth/main.py Auth API · client.js API client
Components 30
Web interface
- Web routes
apps/web/src/app/routes.jsx - Login page
apps/web/src/pages/LoginPage.jsx - Auth state
apps/web/src/store/auth.js - Memory workspace
apps/web/src/pages/AppPage.jsx - Workspace layout
apps/web/src/App.jsx - Chat composer
apps/web/src/components/chat/BottomComposer.jsx - API client
apps/web/src/api/client.js
Identity and spaces
- Auth API
apps/services/auth/main.py - JWT and passwords
apps/services/auth/auth.py - Identity models
apps/services/auth/models.py
Memory API
- Memory API app
apps/services/memory/app/main.py - Chat answers
apps/services/memory/app/routers/chats.py - Save chats
apps/services/memory/app/routers/chat_save.py - Documents
apps/services/memory/app/routers/documents.py - Notes
apps/services/memory/app/routers/notes.py - Vector search
apps/services/memory/app/routers/search.py - Profiles
apps/services/memory/app/routers/profile.py - Inference rules API
apps/services/memory/app/routers/inference_rules.py - Grounded retrieval
apps/services/memory/app/utils/retrieval
Background processing
- Job worker
apps/worker/worker.py - Text ingestion
apps/worker/ingestion - Graph extraction
apps/worker/graph/extract_hybrid.py - Graph persistence
apps/worker/graph/persist.py - Fact consolidation
apps/worker/evolution/consolidate.py - Rule inference
apps/worker/evolution/infer_engine.py - Rule discovery
apps/worker/rules/discovery.py - Rule generation
apps/worker/rules/generator.py - Rule storage
apps/worker/rules/storage.py
Memory data
- PostgreSQL, pgvector, AGE
Other components
- User
Connections 38
- User → Web routes: uses
README.md - Web routes → Login page: routes to
apps/web/src/app/routes.jsx - Web routes → Memory workspace: protects route
apps/web/src/app/routes.jsx - Memory workspace → Workspace layout: renders
apps/web/src/pages/AppPage.jsx - Workspace layout → Chat composer: renders
apps/web/src/App.jsx - Login page → Auth state: updates token
apps/web/src/pages/LoginPage.jsx - API client → Auth state: reads token
apps/web/src/api/client.js - API client → Auth API: calls auth
README.md - API client → Memory API app: calls memory
README.md - Auth API → JWT and passwords: uses
apps/services/auth/main.py - Auth API → Identity models: queries and creates
apps/services/auth/main.py - Auth API → PostgreSQL, pgvector, AGE: reads and writes
apps/services/auth/main.py - Memory API app → Chat answers: registers
apps/services/memory/app/main.py - Memory API app → Save chats: registers
apps/services/memory/app/main.py - Memory API app → Documents: registers
apps/services/memory/app/main.py - Memory API app → Notes: registers
apps/services/memory/app/main.py - Memory API app → Vector search: registers
apps/services/memory/app/main.py - Memory API app → Profiles: registers
apps/services/memory/app/main.py - Memory API app → Inference rules API: registers
apps/services/memory/app/main.py - Chat answers → Grounded retrieval: retrieves evidence
README.md - Vector search → PostgreSQL, pgvector, AGE: queries vectors
apps/services/memory/app/routers/search.py - Grounded retrieval → PostgreSQL, pgvector, AGE: reads vectors and graph
README.md - Documents → PostgreSQL, pgvector, AGE: queues ingestion
README.md - Save chats → PostgreSQL, pgvector, AGE: queues ingestion
README.md - Job worker → PostgreSQL, pgvector, AGE: claims jobs
apps/worker/worker.py - Job worker → Text ingestion: processes documents
apps/worker/worker.py - Job worker → Graph extraction: extracts graph facts
apps/worker/worker.py - Job worker → Graph persistence: persists extraction
apps/worker/worker.py - Graph persistence → PostgreSQL, pgvector, AGE: writes graph evidence
README.md - Job worker → Fact consolidation: consolidates facts
apps/worker/worker.py - Job worker → Rule inference: runs rules
apps/worker/worker.py - Rule inference → PostgreSQL, pgvector, AGE: reads rules, writes edges
apps/worker/evolution/infer_engine.py - Job worker → Rule discovery: discovers relations
apps/worker/worker.py - Job worker → Rule generation: suggests rules
apps/worker/worker.py - Job worker → Rule storage: stores suggestions
apps/worker/worker.py - Inference rules API → PostgreSQL, pgvector, AGE: manages rules
apps/services/memory/app/routers/inference_rules.py - Fact consolidation → PostgreSQL, pgvector, AGE: updates fact lifecycle
README.md - Text ingestion → PostgreSQL, pgvector, AGE: stores chunks
README.md