Agents Quick Start
Vectara Agents are AI assistants that can use tools, follow instructions, and maintain conversation context. This guide shows you how to create and interact with a Vectara agent using the API. We'll walk through the workflow from agent creation to having a conversation. Here is some information about using agents:
- Sessions are required: You cannot chat with an agent directly. You must create a session first.
- Sessions maintain context: All messages within a session share conversation history.
- One agent, many sessions: Multiple users can have separate conversations with the same agent.
- Event-based architecture: All interactions are tracked as events for full auditability.
The agent workflow follows these steps:
- Create an agent - Configure your AI assistant with tools and instructions.
- Create a session - Start a conversation context for message history.
- Send messages - Chat with the agent through the session.
Let's walk through each step with working examples.
Step 1: Create an Agent
First, let's create a simple research assistant agent that can search the web. This example requires no corpus setup, so you can follow along immediately.
Create an agent with the console UI (Recommended)
For your first agent, we recommend using the Console UI. If you need more detailed UI instructions, see Create an Agent.
- Navigate to Agents in the sidebar.
- Click Add Agent.
- Configure each step:
- General: Name:
research-assistant
and description:A research assistant that can search the web for current information
- Model: Select
gpt-5
, and set{"temperature":0.3}
for factual responses - Instructions:
You are a helpful research assistant. When users ask questions, search the web for current and accurate information. Always cite your sources and be honest if you cannot find reliable information.
- Tools: Add Web Search tool with the argument override:
{"limit": 10}
. - Advanced: Add
{"category": "research"}
.
- General: Name:
- Click Create Agent.
Create an agent with the API
Alternatively, create the same agent programmatically:
If you have issues with copy-pasting multi-line command, use a single-line version.
1?
This creates an agent with an auto-generated key like agt_research-assistant_abc123
.
1
Step 2: Create a Session
First, create a session to maintain conversation context:
1
This returns a session object with a key
( ase_12345
) that you need in
the next step.
Step 3: Chat with the Agent
Send user input by creating an event in the session:
1
Complete Example
Here's a complete example using curl:
1?
Test your agent with the console UI
- In the agent details page, click the Chat tab.
- Try asking:
"What are the main benefits of solar energy for average Texas homes?"
- You should see the agent search the web and provide a cited response.
Expected response
The agent acts as follows:
- Uses web search to find current information.
- Provides a summary with key points.
- Includes source citations.
- Shows tool usage in the response events.
Response format
The agent responds with events that include:
input_message
: Your original messagethinking
: The agent's reasoning process (optional)tool_input
/tool_output
: Web search execution and resultsagent_output
: The final response with citations.