How anuj-kumar-04/memcore-self-evolving-continual-memory-sleep-time-compute-os works
MemCore accepts chat and memory-management requests through a FastAPI gateway. The live path compiles a budgeted context from procedural, bi-temporal/episodic, and working memory; the sleep path consolidates turns by extracting facts and corrections, resolving graph changes, updating learned rules, and trimming the buffer. The README documents a web visualizer and optional LLM integrations. Relationships follow the excerpts, SOURCE INDEX references, and README; unsampled implementation details are not inferred.
Main entry points: celery_app.py Sleep Orchestrator · routes_memory.py Memory Routes · context_compiler.py Context Compiler · temporal_graph_pg.py Temporal Graph
Components 16
API and UI
- Visualizer UI
src/ui/index.html - FastAPI Gateway
src/api/main.py - Memory Routes
src/api/routes_memory.py - Memory Schemas
src/api/schemas.py
Live Context
- Context Compiler
src/sleep_engine/context_compiler.py - LLM Inference
Sleep Consolidation
- Sleep Orchestrator
src/sleep_engine/celery_app.py - Fact Extractor
src/sleep_engine/extractor.py - Conflict Resolver
src/sleep_engine/conflict_resolver.py
Memory Tiers
- Working Memory
src/memory_tiers/working_redis.py - Temporal Graph
src/memory_tiers/temporal_graph_pg.py - Procedural Playbook
src/memory_tiers/procedural_playbook.py - Embedding Provider
src/memory_tiers/embeddings.py
Other components
- User / IDE
- Redis
- PostgreSQL + pgvector
Connections 25
- User / IDE → FastAPI Gateway: sends requests
README.md - Visualizer UI → FastAPI Gateway: uses API
README.md - FastAPI Gateway → Memory Routes: registers routes
src/api/main.py - Memory Routes → Context Compiler: compiles chat context
src/api/routes_memory.py - Memory Routes → Sleep Orchestrator: triggers consolidation
src/api/routes_memory.py - Memory Routes → Working Memory: reads memory state
src/api/routes_memory.py - Memory Routes → Temporal Graph: queries history
src/api/routes_memory.py - Context Compiler → Procedural Playbook: fetches rules
src/sleep_engine/context_compiler.py - Context Compiler → Temporal Graph: retrieves facts
src/sleep_engine/context_compiler.py - Context Compiler → Working Memory: fetches recent turns
src/sleep_engine/context_compiler.py - Context Compiler → LLM Inference: provides context
README.md - LLM Inference → User / IDE: returns response
README.md - Working Memory → Redis: stores turns
README.md - Temporal Graph → PostgreSQL + pgvector: stores graph and events
README.md - Procedural Playbook → PostgreSQL + pgvector: persists rules
README.md - Procedural Playbook → Redis: caches rules
README.md - Sleep Orchestrator → Working Memory: retrieves turns
src/sleep_engine/celery_app.py - Sleep Orchestrator → Fact Extractor: extracts facts
src/sleep_engine/celery_app.py - Fact Extractor → LLM Inference: uses structured extraction
README.md - Sleep Orchestrator → Conflict Resolver: resolves triplets
src/sleep_engine/celery_app.py - Conflict Resolver → Temporal Graph: reads and mutates edges
src/sleep_engine/conflict_resolver.py - Sleep Orchestrator → Procedural Playbook: updates learned rules
src/sleep_engine/celery_app.py - Sleep Orchestrator → Working Memory: trims buffer
src/sleep_engine/celery_app.py - Temporal Graph → Embedding Provider: generates vectors
src/memory_tiers/temporal_graph_pg.py - Embedding Provider → LLM Inference: optional remote embeddings
src/memory_tiers/embeddings.py