Attaching to agents
Attach Context Spaces to agents that should use source-backed context.
Registering a Context Space does not automatically give every agent access to it.
An agent opts in with UseContextSpace(...).
Travel guide sample
The travel-agent can use:
| Capability | Why |
|---|---|
travel-planning Context Space | Source-backed city guides and trip planning skill. |
WeatherTool | Weather-aware planning signal. |
TravelBudgetEstimateTool | Approximate budget estimate when requested. |
Plain Agent comparison
The same sample registers Plain Agent without a Context Space:
This is useful for testing. The Plain Agent can answer from its model and instructions, but it does not receive source excerpts or skills from travel-planning.
General pattern
For another domain:
Attach Context Spaces only to agents that should use that source boundary.
| Agent | Context Space |
|---|---|
| Travel Agent | travel-planning |
| Support Agent | product-support |
| Expense Analyst | expense-policy |
| Release Notes Agent | release-notes |
This keeps context access explicit and easier to debug.