Skip to main content
Corpus seeding transforms a repository or documentation set into structured cognitive memory. Unlike RAG (retrieval-augmented generation), which fetches raw text at query time, corpus seeding produces actual beliefs, episodes, notes, and values — giving the agent genuine understanding rather than just search results.

Overview

The pipeline has two stages:
  1. Ingest — chunk source files into semantically meaningful raw entries
  2. Process — iteratively promote raw entries through the memory hierarchy until convergence

Ingesting a Corpus

Source Code

The repo ingestor uses AST-based chunking for Python (extracting functions and classes as discrete units) and paragraph-based chunking for other languages. Each chunk becomes a raw entry tagged with file path, chunk type, and semantic name. Options: Example with filters:

Documentation

The docs ingestor supports Markdown (heading-based chunking), reStructuredText, plain text (paragraph-based), and PDF (page-based chunking via pdfminer.six or PyPDF2). Options:

Chunking Strategies

Deduplication

Chunks are content-hash deduplicated. Re-running seed repo or seed docs on the same corpus skips already-ingested chunks, making it safe to re-run after adding new files.

Check Ingestion Status

Returns counts of corpus raw entries (total, repo, docs).

Processing to Exhaustion

After seeding, process the raw entries through the memory pipeline:
This runs the processing pipeline in iterative cycles with escalating intensity: Processing continues until convergence (2 consecutive cycles with 0 new promotions) or the maximum cycle count is reached.
Processing requires an inference model (e.g., Anthropic API key configured). Without inference, only basic note extraction and deduplication occur.
Options: Safety: A checkpoint (pre-exhaust) is automatically created before the first cycle.

Complete Example

Inspecting Results

After seeding and processing, use the dev dashboard to visually inspect the memory stack:
Or use CLI commands:

Provenance

All promoted memories maintain full provenance chains:
Every memory records derived_from references back to its source. The dev dashboard shows provenance chains for any memory — click a row and check the “Derived from” and “Derived memories (children)” sections.

Directory Exclusions

The following directories are always excluded from corpus ingestion: .git, __pycache__, node_modules, .venv, venv, .tox, .mypy_cache, .pytest_cache, .ruff_cache, dist, build, .eggs, *.egg-info