Layers
The twelve layers that organise every Recohut Kit package, with the core owner and typical use of each.
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
| Layer | Core owner | Typical use |
|---|---|---|
| model_route | recohut_kit.providers | Call a model with receipts, or request strict structured output |
| agent_loop | Native pydantic_ai.Agent with the Harness from recohut_kit_pydantic_ai | Let a model choose tools within governed limits |
| tools_permissions | ToolPolicy in recohut_kit.harness.contracts; recohut_kit.human | Allow, deny or require approval for a tool call |
| harness_state | recohut_kit.harness; recohut_kit.conversations | Keep a run resumable and a conversation history separate |
| context_memory | vectors, retrieval, grounding, user_context, knowledge | Retrieve sources, check citations, remember consented facts |
| guardrails | recohut_kit.guardrails; recohut_kit.redaction | Screen input and output, rate limit, mask personal data |
| evaluation | recohut_kit.evals; recohut_kit_pydantic_ai.evals | Run a suite, grade trajectories, gate a release |
| observability | recohut_kit.phoenix; latency; usage | Trace a run, record latency and usage receipts |
| serving | recohut_kit.runtime; recohut_kit.channels | Expose identity, health and chat over HTTP or Slack |
| data_platform | No single owner | Connect storage engines, warehouses, pipelines and ingestion |
| domain_capability | No single owner | Business operations such as booking, marketing or payments |
| utility | recohut_kit.json | Small 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:
| Question | Layer |
|---|---|
| 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:
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.jsonrather than relying on a number here.
Model route
Agent loop
Tools and permissions
Harness and state
Context and memory
Guardrails
Evaluation
Observability
Serving
Data platform
Domain capability
Utility
How is this page?
Last updated on