Documentation Index
Fetch the complete documentation index at: https://docs.zapthinker.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
API Tools enable your RAG bots to interact with external services and APIs, transforming them from simple Q&A bots into powerful assistants that can perform actions and fetch real-time data. This feature implements function calling, allowing your AI to intelligently decide when to use external tools based on user queries.Key Features
- API Connections: Configure authentication and base URLs for external services
- Custom Tools: Define specific API endpoints as callable tools
- Function Calling: AI automatically determines when to use tools
- RAG Integration: Link tools to specific RAG bots
- Bulk Operations: Sync multiple tools to bots efficiently
- OpenAPI Import: Import entire API specifications automatically
- Connection Testing: Validate API connections before deployment
How It Works
- Create API Connection: Define the base URL and authentication for an external service
- Define Tools: Specify individual endpoints as tools with parameters
- Link to RAG Bot: Connect tools to your RAG bot
- AI Decision Making: The AI determines when to call tools based on user queries
- Execute & Respond: Tool results are incorporated into AI responses
Architecture
API Connections
Connections store authentication and base configuration for external APIs:API Tools
Tools define specific endpoints that can be called:Use Cases
Weather Information
Provide real-time weather data when users ask about weather conditions.Database Queries
Fetch live data from your database (inventory, orders, customer info).CRM Integration
Look up customer information, create tickets, or update records.E-commerce
Check product availability, pricing, or order status.Booking Systems
Check availability and create reservations.Custom Business Logic
Execute any custom function via your own API endpoints.Configuration
Authentication Types
- None: No authentication required
- API Key: Header-based API key authentication
- Bearer Token: OAuth/JWT bearer token
- Basic Auth: Username and password authentication
- Custom Headers: Any custom header configuration
Tool Parameters
Define parameters that the AI will extract from user queries:OpenAPI Import
Automatically import entire API specifications:- Provide OpenAPI/Swagger JSON or YAML
- System creates connection and all tools automatically
- Review and enable desired endpoints
- Link to RAG bots
Linking Tools to RAG Bots
Individual Linking
Link specific tools to specific bots for precise control.Bulk Sync
Sync all tools from a connection to a bot at once:Dynamic Unlinking
Remove tools from bots when no longer needed.Best Practices
- Clear Descriptions: Write detailed tool descriptions so the AI knows when to use them
- Parameter Validation: Define required vs optional parameters clearly
- Error Handling: Ensure your APIs return clear error messages
- Rate Limiting: Consider API rate limits when designing tools
- Security: Use secure authentication methods and never expose sensitive tokens
- Testing: Test connections before linking to production bots
- Documentation: Document your tools for easier maintenance
Function Calling Flow
- User Query: “What’s the weather in New York?”
- AI Analysis: Determines weather tool is needed
- Parameter Extraction: Extracts city=“New York”
- API Call: Executes GET /current?city=New York
- Response Integration: Incorporates weather data into natural response
- User Response: “The current weather in New York is 72°F and sunny.”
Advanced Features
Connection Testing
Test API connections before deployment to catch configuration issues early.Tool Versioning
Maintain multiple versions of tools for A/B testing or gradual rollouts.Usage Analytics
Track which tools are used most frequently to optimize your integrations.Conditional Logic
Tools can return data that triggers different response paths.Security Considerations
- Store API keys securely (never in client code)
- Use HTTPS for all API connections
- Implement rate limiting on your endpoints
- Validate all tool responses before using
- Log tool usage for audit trails
- Rotate API keys regularly
Getting Started
- Create an API connection with authentication
- Define one or more tools for that connection
- Test the connection to verify it works
- Link tools to your RAG bot
- Test with sample queries that should trigger the tools
- Monitor usage and refine tool descriptions

