Documentation Index
Fetch the complete documentation index at: https://docs.contextual.ai/llms.txt
Use this file to discover all available pages before exploring further.
Custom Agent Composer YAML workflows are available in public preview for enterprise users. Template agents (Basic Search and Agentic Search) are available for self-serve users, but creating custom workflows with YAML requires enterprise access. For more information or to request access, please contact your Contextual AI representative.
Each graph specifies inputs → nodes → outputs and runs via
/query/acl.
Minimal Graph
Root-level Fields
| Field | Required | Notes |
|---|---|---|
inputs | ✅ | Root graph accepts only query: str |
outputs | ✅ | Must be JSON-serializable |
nodes | ✅ | Execution steps |
ui_output | ⚠️ | Required if multiple outputs |
Core Rules (Remember These)
- Root graph: one input only (query)
- All node inputs must be wired
- Outputs must be JSON-serializable
- Multiple outputs → set exactly one ui_output
__outputs__node is mandatory
Wiring Syntax
__inputs__→ graph/subgraph inputs__outputs__→ graph outputs
Node Template
type(required)input_mappingconfig(static)config_overrides(runtime)ui_stream_types
Output Node
- No config
- No outputs
- Maps internal values → API outputs
UI Streaming
- Declared per node
- Multiple nodes may stream
- Independent of
ui_output
Subgraphs (Reusable Workflows)
Define:- Nestable
- Reusable
- Isolated I/O scope
Conditional Execution
- Top-down evaluation
- First match executes
- Branch
__inputs__!= graph inputs
Agentic Research Pattern
Standard flow:CreateMessageHistoryStepAgenticResearchStepGenerateFromResearchStep
Message History
Agentic Research
- Multi-turn agent loop
- Plans and invokes tools
- Produces structured research
Tools
- Use either step_config or graph_config
- Inputs = basic Python types
Final Generation
message_history and research as inputs
Run a Graph (Python)
API Response
outputsworkflow_tracedynamic_agent_trace(if agentic steps used)
Common Errors
| Error | Fix |
|---|---|
| Missing node input | Wire it |
No __outputs__ | Add output node |
| Multiple outputs | Set ui_output |
| Non-serializable output | Convert to basic types |