Skip to main content

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

ParameterTypeRequiredDefaultDescription
querystringYes-Search query
collectionstringYes-RAG collection name
top_kintegerNo5Number of results
similarity_thresholdfloatNo0.5Minimum similarity (0-1)
filtersobjectNo-Metadata filters

Web Search Parameters

ParameterTypeRequiredDefaultDescription
querystringYes-Search query
countintegerNo5Number of results
time_rangestringNono_limitTime filter: day, week, month, year

Code Execution Parameters

ParameterTypeRequiredDefaultDescription
codestringYes-Code to execute
languagestringNopythonProgramming language
timeoutintegerNo30Timeout in seconds

Tool Selection Guide

TaskRecommended ToolReason
Search product docsRAG SearchInternal knowledge is more accurate
Find latest newsWeb SearchNeed current, real-time data
Calculate metricsCode ExecutionNeed computation
Analyze dataCode ExecutionProcess data with code
Find answers in FAQRAG SearchFAQ is internal data
Research topicWeb + RAG SearchCombine internal and external
Test code snippetCode ExecutionVerify code works
Document procedureRAG + Code ExecutionSearch 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_tools list
  • Check tool name is correct
  • Review agent configuration

Tool Times Out

Problem: Tool call takes too long

Solution:

  • Increase timeout parameter
  • 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

  1. Use relevant tools - Don't enable unnecessary tools
  2. Set appropriate limits - Control timeout and result count
  3. Monitor costs - Track tool usage and API calls
  4. Handle errors - Implement retry logic for failed tool calls
  5. Validate inputs - Check parameters before calling tools
  6. Cache results - Cache expensive tool calls

Next Steps