Skip to main content

Module consolidation

Module consolidation 

Source
Expand description

Consolidation engine for provider data — hippocampal sleep replay.

Converts provider results into long-term context artifacts:

  1. BM25/embedding index chunks (for future searches)
  2. Cross-source graph edges (for related-file discovery)
  3. Knowledge facts (for semantic memory)
  4. Session cache entries (for fast re-reads at ~13 tokens)

This is the “sleep replay” mechanism: raw episodic data (provider API responses) is consolidated into durable semantic representations.

Scientific basis: Hippocampal memory consolidation (Kitamura, Science 2017). Fast hippocampal (session cache) traces are replayed to build slow neocortical (knowledge + graph + index) representations.

Structs§

CacheableProviderResult
A provider result ready to be stored in the session cache.
ConsolidationArtifacts
Pure artifacts produced by consolidation — no side effects yet.
ConsolidationResult
Result of a consolidation run — tells the caller what was created.

Functions§

apply_artifacts
Apply consolidation artifacts to the live systems.
apply_artifacts_with_pg
consolidate
Consolidate a batch of ContentChunks into all long-term stores.