Context Propagation Guide
Practical guide to using context propagation in real-world applications.
Overviewβ
For detailed technical information about how context propagation works, see Context Propagation Deep Dive.
This guide focuses on practical patterns for using context in your applications.
Quick Startβ
Setting Contextβ
withAgentContext(
"tenantId" to "ACME",
"userId" to "user-123"
) {
// All operations have context!
agent.processComm(comm)
}
Using Context in Toolsβ
val tool = contextAwareTool("my_tool") {
execute { params, context ->
val tenantId = context.tenantId!!
// Use tenantId for scoped operations
}
}
See Alsoβ
- Context-Aware Tools - Build context-aware tools
- Context Propagation Deep Dive - Technical details
- Multi-Tenancy - Multi-tenant patterns