Skip to Content
Recodocs

Layers

The twelve layers that organise every Recohut Kit package, with the core owner and typical use of each.

4 min read

Start with the job that is missing in your application: call a model, find evidence, authorize a tool, keep run state, or serve the result. Every Recohut Kit package belongs to exactly one of twelve layers, each named for the job it owns. The matrix below maps each job to its canonical owner and available alternatives. You can use a single owner without adopting the whole kit.

The layers are not a runtime stack that you must adopt together. They are a classification. You can use the guardrails layer alone, or the data platform layer alone, with no other layer present.

How the layers relate

The boxed group is what happens inside one governed run. Serving and guardrails sit in front of it. Observability and evaluation read what the run records. Domain capability and data platform hold the business operations and stores that tools and retrieval reach. Utility is shared plumbing.

The layer matrix

LayerCore ownerTypical use
model_routerecohut_kit.providersCall a model with receipts, or request strict structured output
agent_loopNative pydantic_ai.Agent with the Harness from recohut_kit_pydantic_aiLet a model choose tools within governed limits
tools_permissionsToolPolicy in recohut_kit.harness.contracts; recohut_kit.humanAllow, deny or require approval for a tool call
harness_staterecohut_kit.harness; recohut_kit.conversationsKeep a run resumable and a conversation history separate
context_memoryvectors, retrieval, grounding, user_context, knowledgeRetrieve sources, check citations, remember consented facts
guardrailsrecohut_kit.guardrails; recohut_kit.redactionScreen input and output, rate limit, mask personal data
evaluationrecohut_kit.evals; recohut_kit_pydantic_ai.evalsRun a suite, grade trajectories, gate a release
observabilityrecohut_kit.phoenix; latency; usageTrace a run, record latency and usage receipts
servingrecohut_kit.runtime; recohut_kit.channelsExpose identity, health and chat over HTTP or Slack
data_platformNo single ownerConnect storage engines, warehouses, pipelines and ingestion
domain_capabilityNo single ownerBusiness operations such as booking, marketing or payments
utilityrecohut_kit.jsonSmall shared helpers

For the three layers without a core owner, the work is domain-specific, so the kit keeps the packages as supported or catalog entries rather than naming one winner.

Choose a layer

Match the question you are asking to a layer:

QuestionLayer
Which model do I call, and how do I record the call?model_route
How do I let a model pick tools?agent_loop
Which tool calls need a person to approve?tools_permissions
How do I pause a run and resume it later?harness_state
Where does the model get its facts and memory?context_memory
What stops a bad input or output?guardrails
How do I know a change made things worse?evaluation
How do I see what happened in a run?observability
How do clients reach the system?serving
Where does the data live?data_platform
Where does the business logic live?domain_capability
Is it just a helper?utility

A layer in code

Layers show up in imports. This sketch uses owners from four layers, all in the core:

four_layers.py
from recohut_kit.guardrails.screening import LexiconScreen, intervene   # guardrails
from recohut_kit.redaction import mask_text                              # guardrails
from recohut_kit.harness.contracts import ToolPolicy                     # tools_permissions
from recohut_kit.storage.sqlite import SQLiteDatabase                    # data_platform

policies = {"lookup": ToolPolicy()}
store = SQLiteDatabase(":memory:")
print(mask_text("mail me a@b.com"))

Limits

  • A layer is a classification of packages, not a promise about quality. See tiers for who depends on each package.
  • A package that touches two jobs is placed by its main job.
  • Counts of packages per layer change as the kit changes. Query the capability index or tiers.json rather than relying on a number here.

How is this page?

Last updated on