Custom Agents
Beyond the builtin agent types, you can create custom agents by composing reusable components into a graph workflow.
Graph Model
Agents in SciLaxy are directed graphs where:
- Nodes represent processing steps (LLM calls, tool executions, decision points)
- Edges define the flow between nodes
- Conditional edges enable branching based on node outputs
The graph is compiled into a LangGraph StateGraph that manages state transitions and execution.
Components
Components are reusable subgraphs that handle specific capabilities:
Components are registered globally and resolved by name at compilation time. You can create new components and use them in any agent graph.
Agent Configuration
An agent's graph is defined in a JSON configuration:
Node Configuration
Each node specifies:
- id — Unique identifier within the graph
- component — Which reusable component to use
- config — Component-specific configuration (tools, prompts, etc.)
Edge Types
- Direct edge — Always transitions from one node to another
- Conditional edge — Evaluates a condition to choose the next node
Compilation Pipeline
Agent configs go through a four-stage pipeline before execution:
- Canonicalize — Normalize the config format, resolve component references, apply defaults
- Validate — Check that all nodes are reachable, edges are valid, and tool references exist
- Compile — Build LangGraph nodes and edges from the canonical config
- Execute — Run the compiled graph with streaming callbacks
Example: Research Agent
For example, a custom research agent can be composed from components:
- clarify — Breaks the research question into sub-questions
- brief — Runs web search and literature search in parallel
- supervisor — Evaluates gathered content, may loop back to brief
- report — Synthesizes everything into a structured report
Each node uses a different component with specialized prompts and tools. The supervisor node uses a conditional edge that either proceeds to report or loops back to brief for more research.