MeridiansMeridians

LLM context hydration

Source path: knowledge-base/knowledge/operations/knowledge-management/02-llm-context-hydration.md

# LLM context hydration

The knowledge base is Meridians' contextual nervous system: it grounds a new agent so it can improve a
specific job without absorbing a flat corpus or inventing a parallel architecture.

## Load in passes, not all at once

1. Identify the task's decision boundary: product promise, vocabulary, runtime contract, security,
   operations, or a narrow subsystem.
2. For an unfamiliar or cross-cutting question, run `npm run knowledge:query -- "<question>"`; otherwise
   open the matching generated [context pack](../../../generated/KNOWLEDGE_CONTEXTS.md), then its single
   maintained hub.
3. Load only the leaf or two leaves needed for the immediate decision. Follow an ownership link instead
   of re-explaining a neighbouring concept. In a narrow or metered viewport, `--read` returns the matching
   sections of the top page with citable line ranges before you spend a turn on the whole file.
4. When the change is already in hand, run `npm run knowledge:owners` to see which maintained pages anchor
   the code it touched, rather than guessing which doc owns the moved behaviour.
5. For a technical or behavioural claim, inspect the named code, generated reference, and canonical record;
   prose provides intent and route, not a competing source of truth.
6. State which sources were consulted, update the owning leaf when the contract moves, and regenerate the
   projections that expose it.

## Boundaries that keep agents grounded

- **Maintained knowledge** explains concepts and points to authority under `knowledge-base/knowledge/`.
- **Generated reference** exposes exhaustive or measured projections under `knowledge-base/generated/`.
- **Diagram source** remains single-purpose under `knowledge-base/diagrams/`; generated diagram aggregates are never
  edited by hand.
- **Code and the canonical record** win when explanatory prose disagrees.

A context pack is intentionally small. It should make the next action better informed, not replace the
agent's obligation to inspect the implementation it changes.

The compiled [knowledge catalog](../../../generated/knowledge-catalog.json) accelerates routing with
summaries, authority, status, headings, links, and code anchors. It is generated metadata, not maintained
truth. Source ingestion and durable synthesis follow the [LLM wiki operations](05-llm-wiki-operations.md)
contract.

The generated [Knowledge Atlas](../../../generated/KNOWLEDGE_ATLAS.md) is the whole-system orientation
surface: corpus weight, concept co-occurrence, cross-branch links, authority, and status. It complements
the hierarchical map; it does not replace task-bounded query and hydration. Term frequency and linkage
are navigation signals, never measures of conceptual importance or correctness.
Open on GitHub

Raw Markdown source