Agent
Agents are the core orchestration unit in the Vectara platform. The agent decides how to respond to user input, when to invoke tools, and how to manage conversation state.
Each agent is configured with:
- A unique key and name following the pattern agt_[identifier]. If you do not provide a key, Vectara generates one automatically based on the name.
- A human-readable description
- Optional instructions
- A list of available tools (referenced by name or ID)
- Optional tool configurations, for example Corpora Search tools configured to grant access to various corpora
- Metadata and versioning controls
- A first_step definition that encompasses optional instructions for the agent's behavior.
Agents operate through a conversational step architecture, processing user input through reasoning, tool execution, and response generation phases. The step-based design enables complex multi-turn workflows and intelligent tool orchestration.
Example agent definition
1
Model configuration
Agents use large language models for reasoning and response generation. You can configure:
- Model: Choose from available models like GPT-4o.
- Parameters: Adjust temperature, max tokens, and other model-specific settings
- Cost optimization: Balance performance with token usage
Create an agent
You can create an agent in the UI wizard, or you can use the API.
Example: Research assistant with web search
Here's how to create a research assistant agent that can search the web for current information. 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
This example requires no corpus setup, making it perfect for immediate testing.
1?
Chat with your agent
After creating an agent, you can interact with it by creating a session and sending messages:
1. Create a session
Sessions provide conversation context and are required for all agent interactions:
1
2. Send messages to the agent
Once you have a session, send messages using the events endpoint:
1
The agent will respond with events including its reasoning, tool usage, and final response.
For a complete step-by-step guide with code examples, see Agent Quick Start.