Skip to main content

Corpora (RAG)

:::note Feature status Corpora is a live, supported feature reachable at the /corpora route, but it is not included in the left-rail navigation (which shows Sessions, Tools, Workflows, Contexts, Memory, Artifacts, Audit log, and Settings). Navigate to it directly or from a project page. The feature is under active development. :::

A corpus is a collection of documents Kenaz has indexed and made retrievable to the model. When you attach a corpus to a session, the model can ask "find me the 5 most relevant chunks for this query" without dumping the whole document set into context.

Use corpora when you have:

  • A set of internal docs the model should know about (engineering notes, runbooks, contracts).
  • A codebase too large to paste into a turn.
  • Reference material you want the model to cite from rather than hallucinate.

Creating a corpus

Corpora view → New corpus.

  1. Pick a name, scope (global / project / session), and an optional tag.
  2. Click Create, then open the corpus row and click Ingest… to add content.
  3. In the Ingest modal, enter the absolute path to a file or directory. Kenaz walks the path, reads supported formats, and chunks the text.

Embeddings use the provider and model configured in Settings → Memory → Embedder. The default embedding model is text-embedding-3-small for OpenAI-compatible providers.

Ingest jobs run in the background. The Ingest modal polls job status and reports completion or errors.

Supported document formats

The chunker processes any file accessible as a local path. Common formats:

  • Plaintext.md, .txt, .rst, .org
  • Code — common code file extensions; chunked by line count (default 50 lines per chunk, configurable in the Ingest modal)
  • PDF — text-extractable PDFs
  • Other formats — files Kenaz can read as UTF-8 text are accepted

Binary files that cannot be read as text are skipped.

Attaching to a session

Corpus attachment to a session is not yet exposed through a UI affordance in the current release. The underlying backend supports per-session corpus scoping; watch the release notes for when the session-level attach flow ships.

Updating a corpus

Re-ingest from the Corpora view by clicking Ingest… on the corpus row again. The ingest job appends new chunks; it does not automatically remove chunks for files that were deleted or renamed. Delete and recreate the corpus to start fresh.

Privacy

  • Documents are read locally and embedded by the configured embedding provider. The full text of each chunk is sent to that provider during ingest.
  • The resulting embeddings (vectors) and chunk text are stored locally in the harness database; never uploaded on their own.
  • The corpus data lives in the harness database at ~/.kenaz/harness/<env>/. Use the Delete corpus action in the UI to remove a corpus and its stored chunks.

Cost

Embedding cost is proportional to total document length. The default model is text-embedding-3-small (OpenAI). Check your provider's current pricing; rates change over time.

Embeddings are computed once at ingest time and reused on every search.