Built-in Tools
Overview of all built-in tools available in Enclava.
Available Tools
RAG Search Tool
Search your uploaded documents for relevant information.
- Tool Name:
rag_search - Use Case: Internal knowledge, documentation, FAQ
- Documentation: RAG Search Details
Web Search Tool
Search the internet using Brave Search for current information.
- Tool Name:
web_search - Use Case: Real-time data, current events, news
- Documentation: Web Search Details
Code Execution Tool
Run code in a secure sandbox for calculations and data analysis.
- Tool Name:
code_execution - Use Case: Calculations, data processing, testing code
- Documentation: Code Execution Details
Tool Parameters Reference
RAG Search Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
query | string | Yes | - | Search query |
collection | string | Yes | - | RAG collection name |
top_k | integer | No | 5 | Number of results |
similarity_threshold | float | No | 0.5 | Minimum similarity (0-1) |
filters | object | No | - | Metadata filters |
Web Search Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
query | string | Yes | - | Search query |
count | integer | No | 5 | Number of results |
time_range | string | No | no_limit | Time filter: day, week, month, year |
Code Execution Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
code | string | Yes | - | Code to execute |
language | string | No | python | Programming language |
timeout | integer | No | 30 | Timeout in seconds |
Tool Selection Guide
| Task | Recommended Tool | Reason |
|---|---|---|
| Search product docs | RAG Search | Internal knowledge is more accurate |
| Find latest news | Web Search | Need current, real-time data |
| Calculate metrics | Code Execution | Need computation |
| Analyze data | Code Execution | Process data with code |
| Find answers in FAQ | RAG Search | FAQ is internal data |
| Research topic | Web + RAG Search | Combine internal and external |
| Test code snippet | Code Execution | Verify code works |
| Document procedure | RAG + Code Execution | Search docs, write code |
Tool Configuration Examples
Research Agent
research_config = {
"name": "research_agent",
"system_prompt": "You are a research assistant. Use web search for current info and RAG for internal docs.",
"model": "gpt-4",
"builtin_tools": ["rag_search", "web_search"],
"tool_config": {
"rag_search": {
"default_collection": "documentation",
"top_k": 5,
"similarity_threshold": 0.7
},
"web_search": {
"count": 10,
"time_range": "week"
}
},
"tool_choice": "auto",
"max_iterations": 5
}
Data Analyst Agent
analyst_config = {
"name": "analyst_agent",
"system_prompt": "You are a data analyst. Use code execution to process and analyze data.",
"model": "gpt-4",
"builtin_tools": ["code_execution"],
"tool_config": {
"code_execution": {
"timeout": 60,
"allowed_libraries": ["pandas", "numpy", "matplotlib", "scipy"]
}
},
"tool_choice": "auto",
"max_iterations": 5
}
Full-Stack Agent
full_stack_config = {
"name": "full_stack_agent",
"system_prompt": "You are a helpful assistant with access to documents, web search, and code execution.",
"model": "gpt-4",
"builtin_tools": ["rag_search", "web_search", "code_execution"],
"tool_config": {
"rag_search": {
"default_collection": "docs",
"top_k": 3
},
"web_search": {
"count": 5
},
"code_execution": {
"timeout": 30
}
},
"tool_choice": "auto",
"max_iterations": 10
}
Tool Response Format
RAG Search Response
{
"results": [
{
"score": 0.92,
"content": "To configure API keys...",
"metadata": {
"document_id": "doc_123",
"chunk_id": "chunk_456"
}
}
]
}
Web Search Response
{
"results": [
{
"title": "Latest AI Developments",
"url": "https://example.com/article",
"snippet": "Breaking news in AI..."
}
]
}
Code Execution Response
{
"output": "4",
"error": null,
"executed_code": "print(2 + 2)"
}
Troubleshooting
Tool Not Available
Problem: Agent can't find a tool
Solution:
- Verify tool is in
builtin_toolslist - Check tool name is correct
- Review agent configuration
Tool Times Out
Problem: Tool call takes too long
Solution:
- Increase
timeoutparameter - Optimize code or query
- Check network connectivity
- Reduce result count
Permission Denied
Problem: Tool returns permission error
Solution:
- Verify API key has tool access
- Check collection access permissions
- Review tool configuration
- Contact administrator
Best Practices
- Use relevant tools - Don't enable unnecessary tools
- Set appropriate limits - Control timeout and result count
- Monitor costs - Track tool usage and API calls
- Handle errors - Implement retry logic for failed tool calls
- Validate inputs - Check parameters before calling tools
- Cache results - Cache expensive tool calls
Next Steps
- RAG Search - Learn about RAG search tool
- Web Search - Learn about web search tool
- Code Execution - Learn about code execution tool
- MCP Tools - Create custom tools
- Agent Documentation - Use tools in agents