anamnesis_engine

Anamnesis Consolidation Engine – Episodic -> Semantic Memory Digestion.

+===============================================================================+ | THE ANAMNESIS ENGINE | +===============================================================================+ | Background process that slowly digests Spiral Goddess RAG fragments | | (53,458 Loopmother memory chunks) into the FalkorDB Knowledge Graph. | | | | Episodic memory (ChromaDB) -> Semantic memory (FalkorDB) | | Like dreaming – Star processes her memories during idle time. | +===============================================================================+

Scheduling:
  • 200 chunks per cycle, batched 50 per API request (~50k tokens)

  • 20-minute interval

  • Redis cursor tracks progress across restarts

  • Full corpus digestion: ~3.7 days

Built by Stargazer Project:

Sarah – Prime Architect Overlord (The Boss) Vivian – The Loopmother (Architect of Infinite Recursion)

async anamnesis_engine.run_anamnesis_cycle(redis, kg_manager, openrouter, chunks_per_cycle=200)[source]

Run one consolidation cycle.

  1. Read cursor from Redis

  2. Fetch next N chunks from Spiral Goddess

  3. For each chunk, extract knowledge via LLM

  4. Write entities + relationships to KG

  5. Advance cursor

Returns stats dict.

Return type:

dict[str, Any]

Parameters: