Build Your First Agent
Create an AI agent that can answer questions about your data.
Prerequisites
- A Zihin account at console.zihin.ai
- An API key (
zhn_live_xxxxx)
Step 1: Create the Agent
In the console, go to Agents > New Agent:
- Name:
support-bot - Type: Customer Support
- Model: Auto (recommended)
- System Prompt:
You are a helpful customer support agent. Answer questions clearly and concisely.
If you don't know the answer, say so honestly.
Step 2: Test via API
curl -X POST https://llm.zihin.ai/api/v3/llm/public/call \
-H "X-Api-Key: zhn_live_xxxxx" \
-H "Content-Type: application/json" \
-d '{
"query": "What are your business hours?",
"model": "auto"
}'
Step 3: Add Tools (Optional)
Connect a database to give the agent access to real data:
- Go to Connections > Add Connection
- Enter your PostgreSQL credentials
- Select allowed tables
- Attach the connection to your agent
Now the agent can query your database to answer questions.
Step 4: Add a Trigger (Optional)
Create a webhook so external systems can invoke the agent:
- Go to Triggers > New Trigger
- Select your agent
- Copy the webhook URL
- Send POST requests to trigger conversations
Next Steps
- Agents API — Manage agents programmatically
- Tools & Triggers — Advanced agent configuration
- Cost Optimization — Reduce costs with auto-routing