Auxiliary Calls & Reasoning Models
Relevant source files
The following files were used as context for generating this wiki page:
Auxiliary Calls represent internal Large Language Model (LLM) requests that the agent performs independently of the main user conversation. These calls handle specific sub-tasks such as summarization, planning, or structured data extraction. The system uses an AuxiliaryClient to manage these requests through OpenAI-compatible API endpoints.
Sources: agent/auxiliary_client.py
Reasoning Models, such as OpenAI's o1 series, provide enhanced cognitive capabilities for complex problem-solving. The agent controls these models by adjusting a reasoning_effort parameter. This parameter determines the computational resources and time the model allocates to "thinking" before generating a response.
Sources: agent/reasoning_effort.py
Auxiliary Client Architecture
The AuxiliaryClient class provides the primary interface for making out-of-band LLM requests. It initializes with a base URL, API key, and an optional default model. The client facilitates synchronous chat completions while maintaining compatibility with standard tool-calling structures.
Sources: agent/auxiliary_client.py:5-15
Core Components
The architecture relies on three main pillars:
- Request Handling: The client formats messages and tool definitions for the API.
- Hook Execution: The system triggers lifecycle events before and after every network call.
- Reasoning Integration: The client passes effort constraints specifically to models that support internal reasoning.
Sources: agent/auxiliary_client.py, agent/auxiliary_hooks.py
The diagram shows the relationship between the client, the reasoning constraints, and the lifecycle hooks.
Sources: agent/auxiliary_client.py:10-40, agent/reasoning_effort.py:1-10, agent/auxiliary_hooks.py:1-15
Reasoning Effort Levels
The ReasoningEffort enumeration defines three distinct levels for advanced models. This configuration is essential for balancing response latency against logical accuracy. Higher effort levels allow the model to explore more complex reasoning paths but increase the time taken to respond.
Sources: agent/reasoning_effort.py:5-12
| Level | Description | Recommended Use Case |
|---|---|---|
low | Minimal reasoning time. | Simple classification or fast summaries. |
medium | Balanced reasoning and speed. | General planning and multi-step logic. |
high | Maximum reasoning depth. | Complex code analysis or mathematical proofing. |
Sources: agent/reasoning_effort.py:5-12
Auxiliary Call Workflow
When the agent initiates an auxiliary call, it follows a strict sequence to ensure observability and proper configuration. The AuxiliaryClient first triggers the pre_auxiliary_call hook. This hook allows the system to log the intended operation or modify the message context.
Sources: agent/auxiliary_client.py:45-55, agent/auxiliary_hooks.py:5-10
The client then transmits the payload to the LLM provider. If the model is a reasoning model (like o1), the reasoning_effort parameter is included in the request body. Once the API returns a result, the post_auxiliary_call hook captures the response and the total duration of the call for performance monitoring.
Sources: agent/auxiliary_client.py:60-75, agent/auxiliary_hooks.py:12-20
This diagram illustrates the flow of data and the execution of hooks during a single auxiliary LLM request.
Sources: agent/auxiliary_client.py:40-80, agent/auxiliary_hooks.py:5-20
Implementation Details
Configuration Parameters
The chat_completions method accepts several parameters to fine-tune the model behavior.
Sources: agent/auxiliary_client.py:35-45
messages: A list of message objects (system, user, or assistant).model: The specific model ID to invoke.tools: A list of tool definitions for function calling.reasoning_effort: An instance of theReasoningEffortenum.
Sources: agent/auxiliary_client.py:35-45
Hook Interfaces
The lifecycle hooks provide visibility into the agent's internal operations.
Sources: agent/auxiliary_hooks.py:1-25
pre_auxiliary_call(call_type: str, model: str, messages: list): Invoked before the request is sent. Thecall_typestring identifies the purpose of the call (e.g., "distillation" or "summarization").post_auxiliary_call(response: any, duration: float): Invoked after the request completes. It receives the raw response and the time taken in seconds.
Sources: agent/auxiliary_hooks.py:1-25, agent/learn_prompt.py:10-20
Use in Skill Authoring
The learn module utilizes auxiliary calls to transform user-described workflows into reusable skills. It gathers source materials and employs reasoning models to distill complex codebases into structured Markdown documentation. The auxiliary client ensures these background tasks do not interfere with the primary user interaction stream.
Sources: agent/learn_prompt.py:5-15, optional-skills/software-development/code-wiki/SKILL.md:5-20
Summary
Auxiliary Calls and Reasoning Models form the backbone of the agent's internal intelligence. By isolating these calls through the AuxiliaryClient, the system maintains a clean separation between user-facing dialogue and background processing. The integration of ReasoningEffort allows the agent to scale its cognitive depth as needed, while the AuxiliaryHooks system provides the necessary instrumentation for auditing and performance tracking.
Sources: agent/auxiliary_client.py, agent/reasoning_effort.py, agent/auxiliary_hooks.py