Creating Your First Agent
This guide walks you through creating your first AI agent from scratch. We’ll build a customer service agent that can answer questions, look up orders, and handle returns.Time to complete: 10-15 minutes
What you’ll build: A customer service agent with order lookup capabilities
What you’ll learn: Agent configuration, tool attachment, and testing
What you’ll build: A customer service agent with order lookup capabilities
What you’ll learn: Agent configuration, tool attachment, and testing
Prerequisites
Before you begin:1
Create an Account
Sign up at app.quiva.ai
2
Select a Plan
Free tier works great for learning
3
Verify Your Email
Check your inbox and verify your email address
Step 1: Create a New Flow
Agents work within flows, so we’ll start by creating a flow:- Navigate to Hub in the left sidebar
- Click Create New Flow
- Name it “Customer Service Agent”
- Click Create
Step 2: Add a Trigger
Every flow needs a trigger to start it. We’ll use a simple HTTP trigger:- Click Add Trigger in the flow builder
- Select HTTP Request
- The trigger will automatically generate a custom endpoint
- Note the endpoint URL for testing later
Step 3: Add an Agent Step
Now let’s add the agent:- Click the + button after the trigger
- Select Agent from the step types
- Your new agent step appears in the flow
Step 4: Configure Information Settings
Click on the agent step to open the configuration panel. Start with the Information tab:Name & Description
Give your agent a clear, descriptive name:Response Mode
Choose how the agent should execute:- Wait for Completion (Recommended)
- Run in Background
The flow waits for the agent to finish before responding. Best for:
- API endpoints that need results
- Real-time responses
- Chat interactions
Agent Instructions
This is where you define what your agent does. Be specific and clear:Good agent instructions include: role, responsibilities, personality, and specific guidelines. Think of it as a job description.
Step 5: Configure Provider Settings
Click the Provider tab to select your AI model:Select Provider
Choose your LLM provider:- Workforce (Recommended)
- OpenAI
- Claude
- Gemini
Our custom model optimized for business use cases. Best balance of performance and cost.Select this for now - it’s included in all plans.
Choose Model
If using Workforce, the default model is already selected. For other providers, choose your model version:- GPT-4 - Most capable, higher cost
- GPT-3.5-Turbo - Fast and cost-effective
- Claude Sonnet - Balanced performance
- Claude Opus - Maximum capability
API Key (Optional)
If using OpenAI, Claude, or Gemini, enter your API key:1
Get Your API Key
Visit your provider’s console:
2
Enter and Save
Paste your API key in the field. Keys are encrypted and securely stored.
Prompt Field
The prompt field shows what will be sent to the agent:You can customize this mapping to pass different data or combine multiple fields. Learn more in Variable Mapping.
Step 6: Configure Context Settings
Click the Context tab to control memory and reasoning:Smart Context
Toggle ON (recommended):- Improves response quality
- Reduces token usage
- Prevents context overload
Prompt Optimization
Toggle ON (recommended):Maximum Tokens
Set the context limit (default is good for most cases):What are tokens? Roughly 4 characters = 1 token, or about 0.75 words.
50,000 tokens ≈ 37,500 words of context
50,000 tokens ≈ 37,500 words of context
Message History Limit
Set how many previous messages to remember:Maximum Reasoning Steps
Limit how many times the agent can use tools or reason:
Step 7: Add Tools (Optional but Recommended)
Tools give your agent the ability to access data and perform actions. Let’s add an order lookup tool:For this tutorial, we’ll keep it simple without tools. You can add them later by following the Tools & Connectors Guide.
- Click Tools tab in the agent configuration
- Click Add Tool
- Select from available MCP servers or API integrations
- Configure authentication and parameters
- Knowledge Base Search - Look up help articles
- Order Lookup API - Get order status and tracking
- CRM Integration - Access customer history
- Ticketing System - Create support tickets
Step 8: Define Output Schema (Optional)
Output schemas ensure your agent returns data in a specific format. This is useful for:- Structured data extraction
- Integration with other systems
- Validation and error handling
Learn more about output schemas in Provider Settings.
Step 9: Save Your Agent
Your agent is now configured! Click Save to save your changes.
Step 10: Test Your Agent
Time to test! Let’s make sure your agent works:Using the Test Panel
- Click Test in the top right of the flow builder
- Enter a test message in the trigger body:
- Click Run Test
- Watch your agent process the request and respond
Expected Response
Your agent should respond with something like:Try Different Questions
Test with various scenarios:Order Status Question
Order Status Question
Return Request
Return Request
General Question
General Question
Complex Scenario
Complex Scenario
Step 11: Deploy Your Agent
Once you’re happy with the testing:- Click Deploy in the top right
- Your flow is now active and ready to receive requests
- Note your HTTP endpoint URL from the trigger
Calling Your Agent
You can now call your agent via the HTTP endpoint:Congratulations! 🎉
You’ve built and deployed your first AI agent! Here’s what you accomplished: ✅ Created a customer service agent✅ Configured information, provider, and context settings
✅ Tested with multiple scenarios
✅ Deployed to production
Next Steps
Now that you have a working agent, here are some ways to enhance it:Add Tools
Connect to your CRM, knowledge base, or APIs
Improve Instructions
Learn prompt engineering best practices
Add Human Review
Add approval steps for critical actions
Create More Flows
Build different agents for different use cases
Use Different Triggers
Add forms, chat, email, or schedules
Advanced Configuration
Fine-tune performance and behavior
Common Issues & Solutions
Agent isn't responding
Agent isn't responding
Check:
- Is the flow deployed (not just saved)?
- Is the trigger configured correctly?
- Are you sending the request to the right endpoint?
- Check the execution logs for errors
Responses are too generic
Responses are too generic
Fix:
- Add more specific instructions
- Include examples in the agent instructions
- Increase token limits for more context
- Add relevant tools for data access
Agent is too slow
Agent is too slow
Optimize:
- Reduce token limits if set too high
- Limit reasoning steps
- Use a faster model (GPT-3.5 vs GPT-4)
- Disable prompt optimization if not needed
Costs are higher than expected
Costs are higher than expected
Reduce costs:
- Use Workforce model instead of bringing your own
- Lower token limits
- Reduce message history
- Limit reasoning steps
- Use Smart Context to optimize memory