Skip to content
masterclass Buddy

LangChain · Option

context_schema

context_schema defines the type and shape of per-run context for an agent. Use it with a dataclass or TypedDict, then pass matching data through context when invoking the agent.

Last updated

Syntax

create_agent(..., context_schema=Context)
create_deep_agent(..., context_schema=Context)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • context
  • runtime.context
  • ToolRuntime
  • invoke
  • ainvoke

Source: Context engineering in Deep Agents. Checked 2026-11-03.