Skip to content

Data retrieval for AI agents

Simple, open-source data retrieval with unmatched control, precision, and speed.

Quickstart Learn more

from toolfront import Database

# Connect +10 databases and warehouses
db = Database("postgres://user:pass@localhost:5432/mydb")

answer = db.ask("What's the revenue of our top-5 products")
print(answer)
from toolfront import API

# Connect any API with a spec
api = API("http://localhost:8000/openapi.json")

answer = api.ask("Get the latest ticket for user_id=42")
print(answer)
from toolfront import Document

# Connect any document
doc = Document("/path/annual_report.pdf")

answer = doc.retrieve("What were the montlhly payments?")
print(answer)


Bring your data and LLM.

PostgreSQL
MySQL
SQLite
Snowflake
BigQuery
Databricks
DuckDB
Supabase
Oracle
SQL Server
ChatGPT
Claude
Gemini
Mistral
xAI Grok
Hugging Face
DeepSeek
Groq


Zero Configuration

Skip config files and infrastructure setup. ToolFront works out of the box with all your data and models.

Learn More

pip install "toolfront[postgres]"

export OPENAI_API_KEY=<YOUR-KEY>

Database("postgres://...", model="openai:gpt-4o")
uv add "toolfront[snowflake]"

export ANTHROPIC_API_KEY=<YOUR-KEY>

Database("snowflake://...", model="anthropic:claude-3-5-sonnet")
poetry add "toolfront[bigquery]" 

export GOOGLE_API_KEY=<YOUR-KEY>

Database("bigquery://...", model="google:gemini-pro")
from toolfront import Database

db = Database("postgres://user:pass@host/db")

best_seller: str = db.ask("What's our best-seller?")
# Returns: "Laptop Pro"

total_orders: int = db.ask("How many orders do we have?")
# Returns: 125

has_inventory: bool = db.ask("Do we have pending refunds?")
# Returns: True
from toolfront import Database

db = Database("mysql://user:pass@host/ecommerce")

monthly_sales: list[int] = db.ask("Monthly sales this year?")
# Returns: [15000, 18000, 22000]

sales_by_region: dict[str, int] = db.ask("Sales by region?")
# Returns: {"North": 45000, "South": 38000}

unique_brands: set[str] = db.ask("What brands do we carry?")
# Returns: {"Apple", "Dell", "HP"}
from toolfront import API

api = API("https://api.example.com/openapi.json")

price: int | float = api.ask("Price of product XYZ?")
# Returns: 30 or 29.99

result: list[str] | str = api.ask("Best-sellers this month?")
# Returns: ["Product A", "Product B"] or "Product C"

error: str | None = api.ask("What was the error message?")
# Returns: "Connection timeout" or None
from toolfront import Document
from pydantic import BaseModel

doc = Document("/path/to/invoice.pdf")

class Customer(BaseModel):
    name: str
    seats: int
    is_active: bool

top_customer: Customer = doc.ask("Who's our latest customer?")
# Returns: Customer(name='Acme', seats=5, is_active=True)

Predictable Results

Data is messy. ToolFront returns structured, type-safe responses that match exactly what you want.

Learn more

Use it Anywhere

Avoid migrations. Run ToolFront directly, as an MCP server, or build custom tools for any AI framework.

Learn more

{
  "mcpServers": {
    "toolfront": {
      "command": "uvx",
      "args": [
        "toolfront[postgres]", 
        "postgres://user:pass@host/db"
      ]
    }
  }
}
from toolfront import Database

db = Database("postgresql://user:pass@host/db")

def get_data(query: str):
    """Get data from the database."""
    context = "Sales data is in `orders` table. Revenue in USD."
    return db.ask(query, context=context)

# Use this function as a tool in any framework
tools = [get_data]