Try the live demo

What it does
This agent provides a chat interface for querying your data in natural language. Users can:- Ask questions about their data in plain English
- View query results in a formatted table
- Have multi-turn conversations to drill down into the data
Architecture
The application has two main components:Frontend (Next.js + CopilotKit)
- Next.js provides the web application framework
- CopilotKit provides the chat UI components and handles communication with the backend agent
- Data tables display query results returned from the agent
Backend (Pydantic AI + Snow Leopard)
- Pydantic AI agent with two tools:
get_data: Calls Snow Leopard to convert natural language to SQL and retrieve resultsread_get_data_response: Allows paginated reading of large result sets
- AG-UI state management keeps the frontend in sync with query results
- Snow Leopard handles natural language to SQL conversion
Run the example
Prerequisites
- Python 3.12+
- Node.js 20+
- uv package manager
- pnpm (or npm)
- OpenAI API key
- Snow Leopard API key
- A datafile uploaded to Snow Leopard Playground
Don’t have data? This example uses northwind.db, a public sales database. You can download it from our sample datasets using this link.
Setup
Clone the repository:.env file in the agent folder:
Next steps
- View the full source code on GitHub
- Learn more about CopilotKit
- Explore the Pydantic AI quickstart