Skip to main content
Who: Agent Builders, AI Engineers
Output: Autonomous AI agents with memory and tool use
Build AI agents that can call tools, remember context, and integrate with MCP servers—all backed by Pixeltable’s persistent storage and orchestration.
Declarative Agents: Instead of imperative control flow, define your agent as a table with computed columns. Each row is a user query; computed columns define the reasoning chain (tool selection → execution → context retrieval → response). Pixeltable handles orchestration, caching, and persistence automatically.

Agent Capabilities

Tool Calling

Register UDFs and queries as tools that LLMs can invoke

Persistent Memory

Store conversation history and retrieved context in tables

MCP Integration

Connect to Model Context Protocol servers for external tools

RAG Retrieval

Semantic search over documents, images, and more

Data Lifecycle

Define Tool UDFs

Wrap any Python code as @pxt.udf tools—API calls, web scraping, database queries
import pixeltable as pxt
import requests
import yfinance as yf

@pxt.udf
def get_latest_news(topic: str) -> str:
    """Fetch latest news using NewsAPI."""
    response = requests.get(
        "https://newsapi.org/v2/everything",
        params={"q": topic, "apiKey": os.environ["NEWS_API_KEY"]}
    )
    articles = response.json().get("articles", [])[:3]
    return "\n".join(f"- {a['title']}" for a in articles)

@pxt.udf
def fetch_financial_data(ticker: str) -> str:
    """Fetch stock data using yfinance."""
    stock = yf.Ticker(ticker)
    info = stock.info
    return f"{info['shortName']}: ${info['currentPrice']}"

UDF Guide

Writing custom functions

Define Query Tools

Turn semantic search into callable tools with @pxt.query
@pxt.query
def search_documents(query_text: str, user_id: str):
    """Search documents by semantic similarity."""
    sim = chunks.text.similarity(query_text)
    return (
        chunks.where((chunks.user_id == user_id) & (sim > 0.5))
        .order_by(sim, asc=False)
        .select(chunks.text, source_doc=chunks.document, sim=sim)
        .limit(20)
    )

@pxt.query
def search_video_transcripts(query_text: str):
    """Search video transcripts by text."""
    sim = transcript_sentences.text.similarity(query_text)
    return (
        transcript_sentences.where(sim > 0.7)
        .order_by(sim, asc=False)
        .select(transcript_sentences.text, source_video=transcript_sentences.video)
        .limit(20)
    )

Register Tools

Combine UDFs, queries, and MCP tools into a single registrypxt.tools()
# Register tools from multiple sources
tools = pxt.tools(
    # UDFs - External API Calls
    get_latest_news,
    fetch_financial_data,
    # Query Functions - Agentic RAG
    search_documents,
    search_video_transcripts,
)

Tool Calling Cookbook

Complete tool calling walkthrough

Built with Pixeltable


Last modified on January 29, 2026