Skip to main content
Version: 2.0

Create agent example

Let's create an agent with the API.

Research assistant agent

This agent completes the following tasks:

  • Search the web when users ask questions requiring current information.
  • Limit search results to 20 for comprehensive responses.
  • Use a lower temperature (0.3) for more consistent, factual responses.
  • Follow instructions to cite sources and admit uncertainty when appropriate.
  • Configure retry logic to handle transient API failures gracefully.

This example requires no corpus setup, making it perfect for immediate testing.

COMPLETE AGENT CHAT EXAMPLE

Code example with bash syntax.
1?

Test your agent with the console UI

  1. Navigate to Agents in the sidebar and find this research assistant agent.
  2. In the agent details page, click the Chat tab.
  3. Try asking quetsions like: "What are the main benefits of solar energy for average Texas homes?"
  4. You should see the agent search the web and provide a cited response.

Expected response

The agent acts as follows:

  1. Uses web search to find current information.
  2. Provides a summary with key points.
  3. Includes source citations.
  4. Shows tool usage in the response events.

Response format

The agent responds with events that include:

  • input_message: Your original message
  • thinking: The agent's reasoning process (optional)
  • tool_input/tool_output: Web search execution and results
  • agent_output: The final response with citations.