Tool integration connects AI agents to external systems, databases, and services, enabling them to perform actions beyond conversation. This guide explores the options for implementing tools in Prisme.ai and provides practical examples for different integration scenarios.Documentation Index
Fetch the complete documentation index at: https://prismeai-legacy.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Understanding Tool Integration
Tools in Prisme.ai represent functional capabilities that agents can use to:- Access external data from APIs, databases, and services
- Perform actions in connected systems
- Process information using specialized logic
- Execute workflows across multiple systems
Tool Integration Approaches
Prisme.ai offers multiple approaches to tool integration, each suited to different requirements and technical expertise levels:- No-Code in AI Knowledge
- Low-Code in AI Builder
- Code-Based in AI Builder
- Business users and subject matter experts
- Simple integrations with existing systems
- Quick deployment of common tool types
- Combining knowledge and tool capabilities
- Visual tool configuration
- Pre-built tool templates
- Custom tool definition
- Direct integration with RAG agents
- Basic error handling
The AI Builder Foundation
AI Builder provides the foundational capabilities for all tool integrations in Prisme.ai, built on these core concepts:Workspaces
- Unique slug identifier
- Access control and sharing
- Integration configuration
- Event visibility and management
Automations
- Triggering via events, URLs, or schedules
- Sequential or parallel execution
- Conditional branching and loops
- Variable management
- Error handling
Event-Driven Architecture
- System and custom events
- Event publishing and subscription
- Asynchronous/synchronous operations
- Event history and monitoring
Apps Marketplace
- Ready-to-use connectors
- Configuration options
- Documentation access
- Custom blocks and automations
Creating Tools in AI Knowledge
For business users, AI Knowledge provides a straightforward interface for adding tools to agents:Access Tool Configuration
- View currently configured tools
- Add new tools
- Edit existing tool configurations
- Test tool functionality
Select Tool Type
- Built-in tools: Web browsing, image generation, code interpreter
- Custom tools: API endpoints, AI Builder automations
- Third-party tools: Integrations from the marketplace
Configure Tool Parameters
- Tool name and description (used by the LLM for selection)
- Required parameters (what the agent needs to provide)
- Authentication settings
- Output formatting preferences
- Usage limits and constraints
Connect to Backend
- A built-in service endpoint
- An AI Builder automation
- An external API endpoint
- A marketplace app integration
Building Custom Tools in AI Builder
For more advanced requirements, AI Builder provides comprehensive capabilities for creating custom tools:Create an Automation
- Unique slug identifier
- Human-readable name
- Description (critical for LLM understanding)
- Trigger type (endpoint for tools)
Define Input Schema
- Required and optional parameters
- Parameter types and constraints
- Default values where appropriate
- Descriptive field names
- Validation rules
Implement Logic
- Visual workflow with built-in actions
- Native YAML workflows event driven or Custom code (Python/Node.js)
- Conditional branching and loops
- Error handling and retries
- Integration with external systems
Format Response
- Structured data for easy LLM processing
- Clear labeling of results
- Error information when needed
- Context for result interpretation
- Performance metrics if relevant
Example: Web Browsing Tool Implementation
Let’s examine the implementation of a Web Browsing tool:Tool Definition
Tool Definition
- A unique identifier (
slug) - A descriptive name for organization
- A clear description for LLM understanding
- The trigger type (endpoint)
- Output format specification
- Categorizing labels
Input Schema
Input Schema
- Defines the required structure of input data
- Sets constraints on parameter values (e.g., enums)
- Provides descriptive titles for parameters
- Includes options for different search types
- Specifies format validation requirements
Logic Implementation
Logic Implementation
- Validates permissions and authentication
- Handles security constraints
- Calls an external service (Serper)
- Processes the results
- Formats the output for the agent
Common Tool Integration Patterns
API Integration
Database Query
Conditional Processing
Multi-System Orchestration
Best Practices for Tool Integration
Clear Tool Descriptions
Clear Tool Descriptions
- What the tool does
- What it returns
- When it should be used
Well-Structured Parameter Schemas
Well-Structured Parameter Schemas
- Descriptive titles and descriptions
- Clear constraints (min/max)
- Default values where appropriate
- Self-documenting parameter names
Comprehensive Error Handling
Comprehensive Error Handling
- Handles specific error cases differently
- Provides clear, actionable error messages
- Includes context about what went wrong
- Enables the agent to respond appropriately
Proper Authentication Management
Proper Authentication Management
- Store sensitive credentials in configuration, not hardcoded
- Use appropriate authentication mechanisms for each service
- Handle token expiration and refresh when needed
- Implement proper error handling for authentication failures
Efficient Performance
Efficient Performance
- Request only needed data (e.g., specific fields, limit result counts)
- Use caching where appropriate for frequently accessed data
- Implement timeouts to prevent long-running operations
- Monitor and optimize query performance
- Consider asynchronous patterns for long-running operations
Integration with AI Knowledge
Once you’ve created tools in AI Builder, you can make them available to agents in AI Knowledge:Register the Tool
- Adding appropriate labels (e.g., ‘tools’)
- Ensuring the automation has an endpoint trigger
- Verifying the description is LLM-friendly
- Checking the parameter schema is complete
Configure in AI Knowledge
- Navigate to the Tools section
- Select “Add Custom Tool”
- Choose your AI Builder automation
- Configure any additional settings
Create Usage Instructions
- Clear criteria for when to use the tool
- Guidance on parameter formatting
- Examples of successful usage
- Error handling recommendations
Monitoring and Debugging Tool Execution
AI Builder’s Activity view provides comprehensive visibility into tool execution: This view allows you to:- See all events in chronological order
- Filter by event type, status, or date range
- View detailed execution information
- Diagnose errors and performance issues
- Track tool usage patterns
Security Considerations
When integrating tools, consider these security best practices:Authentication Management
- Store credentials securely in configuration
- Use appropriate auth mechanisms (OAuth, API keys, etc.)
- Implement proper token management
- Follow the principle of least privilege
Access Control
- Limit tool access to appropriate users
- Validate permissions before execution
- Implement proper tenant isolation
- Audit tool usage regularly
Data Handling
- Minimize sensitive data exposure
- Implement proper data sanitization
- Follow data retention policies
- Handle PII according to regulations
Input Validation
- Validate all parameters before use
- Implement strict schema validation
- Protect against injection attacks
- Handle unexpected inputs gracefully
Advanced Integration Techniques
Multi-Step Tool Orchestration
Multi-Step Tool Orchestration
- Maintains workflow state throughout execution
- Emits events at key points for monitoring
- Breaks complex processes into manageable steps
- Creates an audit trail of actions
Hybrid RAG and Tool Usage
Hybrid RAG and Tool Usage
- Configure both RAG and tools in AI Knowledge
- Provide clear instruction on when to use each capability
- Create tools that supplement knowledge gaps
- Implement tools that can act on retrieved information
Dynamic Tool Selection
Dynamic Tool Selection
- Allows explicit source selection
- Implements fallback strategies
- Optimizes data access paths
- Provides consistent result formatting