HTTP KB vs HTTP Actions
Understanding the differences and when to use each
What's the Difference?
HTTP Knowledge Base and HTTP Actions are two different features for integrating your agent with external systems. Both work in real-time, but serve very different purposes.
For fetching data from external APIs so your agent can answer with up-to-date information
For performing actions via API - sending data, creating orders, updating information, etc.
Quick Comparison
| Aspect | HTTP Knowledge Base | HTTP Actions |
|---|---|---|
| Purpose | FETCH DATA (To answer users) | PERFORM ACTION (Change/send data) |
| When Executed | Automatically when user asks and agent needs fresh data | When user asks agent to do something |
| Side Effects | None - only reads data | Yes - changes data in system |
| HTTP Method | Biasanya GET | POST, PUT, PATCH, DELETE |
| Example Use Cases | Check stock, server status, weather data | Send message, create order, update status |
HTTP Knowledge Base
🎯 What For?
HTTP KB is used when your agent needs to fetch LATEST data from external APIs to answer user questions. Data is fetched in real-time when users ask.
✅ When to Use
User: "What's the stock of shoes size 42?" → Agent fetches from your inventory API
User: "Is production server online?" → Check from monitoring API
User: "Jakarta weather today?" → Fetch from weather API
User: "What's today's total sales?" → Get from analytics API
HTTP KB is for READ only. It doesn't change anything in your system - just fetches information to answer users.
HTTP Actions
🎯 What For?
HTTP Actions are used when users want your agent to DO SOMETHING via API - send messages, create orders, update data, and other actions that change state in your system.
✅ When to Use
User: "Send report to manager" → POST to messaging API
User: "Order 10 units of product X" → Create order via API
User: "Change order status to complete" → PUT/PATCH to API
User: "Cancel order #123" → DELETE or update via API
🔐 Public vs Private Actions
No login required. For actions that don't need user-specific data.
Example: Subscribe newsletter, send general feedback
User MUST login first. For actions requiring authentication and user data.
Example: Transfer money, check personal balance, update profile
HTTP Actions change data in your system. Make sure your API endpoints are secure and have proper validation!
How to Choose the Right One
Ask yourself: What does the user want to do?
- User wants to KNOW latest information from external systems
- Data needed is always changing (stock, weather, status)
- Nothing gets changed - just reading data
- User wants to DO something through the agent
- Data will be sent, changed, or deleted
- Action changes state in your system
Combined Usage Examples
Scenario: E-commerce Bot
- Check specific product stock
- Ask for latest prices
- Check order shipping status
- Create new order
- Cancel order
- Update shipping address
Scenario: Support Bot
- Check support ticket status
- List user's open tickets
- Check support agent availability
- Create new support ticket
- Escalate ticket to supervisor
- Close resolved ticket
Common Mistakes
Wrong because HTTP Actions should be for actions that change data, not just reading.
Correct:
Use HTTP KB for reading/checking any data
Wrong because HTTP KB is designed for READ-only, not for changing system state.
Correct:
Use HTTP Actions for all actions that send/change data
Summary
🎯 Purpose
Fetch latest data to answer
⚡ Characteristics
READ-only, changes nothing
💡 Example
Check stock, status, weather, analytics
🎯 Purpose
Perform actions that change data
⚡ Characteristics
WRITE, has side effects
💡 Example
Send message, create order, update, delete
Learn More
HTTP Knowledge Base
Complete guide to creating HTTP KB for fetching real-time data from external APIs
HTTP Actions
Learn how to create HTTP Actions to execute actions via API
Persistent Context
How to use Persistent Context for Private Actions and session management
Login Action
Guide to creating Login Action and configuring response mapping for auth