Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.clarifeye.ai/llms.txt

Use this file to discover all available pages before exploring further.

Tools define custom search capabilities for AI agents.

List Tools

# List all tools in the warehouse
tools = warehouse.list_tools()
for tool in tools:
    print(f"Tool: {tool['name']}")
    print(f"  Type: {tool['type']}")
    print(f"  Description: {tool['description']}")

Create a Search Tool

# Create a semantic search tool
tool = warehouse.create_tool({
    "name": "search_invoices",
    "type": "search",
    "description": "Search for invoices in the knowledge base",
    "search_mode": "semantic",  # or "full_text", "hybrid"
    "indexes": ["chunks"],
    "default_top_k": 5,
    "rerank": True,
    "reformulate_query": False,
    "included_tags": {"document_type": "invoice"},
    "excluded_tags": {}
})

print(f"Created tool: {tool['id']}")

Create a Templated Query Tool

# Create a tool that uses a Cypher template
tool = warehouse.create_tool({
    "name": "find_invoices_by_vendor",
    "type": "templated_query",
    "description": "Find invoices for a specific vendor",
    "query_template": """
        MATCH (o:Object)-[:BELONGS_TO]->(d:Document)
        WHERE o.json_object.vendor = $vendor_name
        RETURN o.json_object, d.name
        LIMIT $limit
    """,
    "variables": ["vendor_name", "limit"]
})

Update a Tool

# Update an existing tool
updated_tool = warehouse.update_tool(
    tool_id="tool-id",
    tool={
        "name": "search_invoices",
        "description": "Updated description",
        "default_top_k": 10
    }
)

Run a Tool

# Run a tool with input parameters
result = warehouse.run_tool(
    tool_id="tool-id",
    input={
        "query": "backend engineers jobs",
        "top_k": 10
    }
)

print(result)
The input dictionary should contain the parameters expected by the tool (e.g., query, top_k for search tools, or template variables for templated query tools).

Delete a Tool

# Delete a tool
warehouse.delete_tool(tool_id="tool-id")