Advanced

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.

HTTP KB

For fetching data from external APIs so your agent can answer with up-to-date information

HTTP Actions

For performing actions via API - sending data, creating orders, updating information, etc.

Quick Comparison

AspectHTTP Knowledge BaseHTTP Actions
PurposeFETCH DATA
(To answer users)
PERFORM ACTION
(Change/send data)
When ExecutedAutomatically when user asks and agent needs fresh dataWhen user asks agent to do something
Side EffectsNone - only reads dataYes - changes data in system
HTTP MethodBiasanya GETPOST, PUT, PATCH, DELETE
Example Use CasesCheck stock, server status, weather dataSend 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

Check Real-time Stock

User: "What's the stock of shoes size 42?" → Agent fetches from your inventory API

System Status

User: "Is production server online?" → Check from monitoring API

Weather Data

User: "Jakarta weather today?" → Fetch from weather API

Reports & Analytics

User: "What's today's total sales?" → Get from analytics API

💡 Remember:

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

Send Message/Notification

User: "Send report to manager" → POST to messaging API

Create Order

User: "Order 10 units of product X" → Create order via API

Update Data

User: "Change order status to complete" → PUT/PATCH to API

Delete Data

User: "Cancel order #123" → DELETE or update via API

🔐 Public vs Private Actions

Public Actions

No login required. For actions that don't need user-specific data.

Example: Subscribe newsletter, send general feedback

Private Actions

User MUST login first. For actions requiring authentication and user data.

Example: Transfer money, check personal balance, update profile

⚠️ Warning:

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?

Use HTTP KB if:
  • User wants to KNOW latest information from external systems
  • Data needed is always changing (stock, weather, status)
  • Nothing gets changed - just reading data
Use HTTP Actions if:
  • 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

HTTP KB
  • Check specific product stock
  • Ask for latest prices
  • Check order shipping status
HTTP Actions
  • Create new order
  • Cancel order
  • Update shipping address

Scenario: Support Bot

HTTP KB
  • Check support ticket status
  • List user's open tickets
  • Check support agent availability
HTTP Actions
  • Create new support ticket
  • Escalate ticket to supervisor
  • Close resolved ticket

Common Mistakes

❌ Using HTTP Actions just to check data

Wrong because HTTP Actions should be for actions that change data, not just reading.

Correct:

Use HTTP KB for reading/checking any data

❌ Using HTTP KB for actions that change 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

HTTP KB

🎯 Purpose

Fetch latest data to answer

⚡ Characteristics

READ-only, changes nothing

💡 Example

Check stock, status, weather, analytics

HTTP Actions

🎯 Purpose

Perform actions that change data

⚡ Characteristics

WRITE, has side effects

💡 Example

Send message, create order, update, delete

Learn More