Data retrieval for AI agents ¶
Simple, open-source data retrieval with unmatched control, precision, and speed.¶
Bring your data and LLM.
Zero Configuration¶
Skip config files and infrastructure setup. ToolFront works out of the box with all your data and models.
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
Predictable Results¶
Data is messy. ToolFront returns structured, type-safe responses that match exactly what you want.
Use it Anywhere¶
Avoid migrations. Run ToolFront directly, as an MCP server, or build custom tools for any AI framework.
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]