We’re currently in research preview! We’re excited to share our system with you, and we would love to hear your feedback. If you have thoughts, we’d love to hear from you.
Basic Workflow
- Define your prompt - Describe what you want the agent to accomplish
- Create your tools - Define the functions your agent can use (optional)
- Call the API - Send your request and get intelligent results
Code Examples
Example 1: Calling an Agent with No Tools
The simplest use case - just send a prompt and get a response.Example 2: Calling an Agent with One Tool
Add a single tool to extend your agent’s capabilities.Example 3: Calling an Agent with Multiple Tools
Combine multiple tools for more sophisticated agent behavior.Interpreting Results
Because Subconscious uses an OpenAI-compatible API, the response structure follows the standard OpenAI format. All of the agent’s reasoning and final answer is contained within thechoices[0].message.content
field as a JSON object. This field is not a simple string - it’s always a structured JSON that provides detailed insights into the agent’s reasoning process and tool usage.
Response Structure
Thechoices[0].message.content
field contains JSON that always contains the engine’s reasoning
and answer
. The object that follows this TypeScript interface:
Response Fields Explained
reasoning
: An array ofTask
objects that show the agent’s step-by-step reasoning processanswer
: The final, human-readable answer to your original prompt
Task Structure
Each task in the reasoning array can contain:thought
: The agent’s internal reasoning about what to do nexttitle
: A descriptive title for this reasoning steptooluse
: Details about a tool call, including:parameters
: The input parameters sent to the tooltool_name
: The name of the tool that was calledtool_result
: The result returned by the tool
subtasks
: Nested tasks showing more detailed reasoning stepsconclusion
: The agent’s conclusion after completing this reasoning step
Example Response
The a simplifiedchoices[0].message.content
response will contain JSON like this:
Other Response Fields
The complete API response also includes:usage
- Token usage information for the requestmodel
- The model that was used for the completion
- Understand how your agent arrives at its final answer
- Debug your agent’s reasoning process
- Monitor tool usage and results
- Optimize your tool configurations