Architecture
Layered Design
-
Primitives
- runnables
- prompts
- output parsers
-
Model Adapters
- provider-specific wrappers implementing
Model ModelRunnablebridge for chain usage
- provider-specific wrappers implementing
-
Agent Runtime
- instruction interpretation
- tool execution
- memory context propagation
-
Applications
- playground and downstream products
Execution Paths
Chain Path
input -> runnable composition -> parsed structured output
Agent Path
user input -> model nodes -> tool calls/final response -> loop until final
Why This Structure
- Keeps primitives reusable outside agent runtime.
- Allows deterministic testing of chain stages.
- Keeps provider code isolated from orchestration logic.