Building Agents with Pydantic AI, Logfire and SurrealDB
👉 Pydantic’s Chris Samiullah shows how to build production-ready agents using Pydantic AI + Logfire for observability, with SurrealDB as the multi-model database backend. Filmed at our London meetup, he also walks through a trading app example, where he talks about his experience swapping out Postgres + pgvector for SurrealDB - and discoveries along the way. Chapters: 00:00 Intro: what we’re doing (migrating app to SurrealDB + observability) 00:00 Pydantic Stack overview (AI, Logfire, Gateway) 02:03 Demo app: RAG “trader” assistant overview 04:02 Embeddings setup (Ent AI + instrumentation) 04:50 Live ingest demo (CLI) + Logfire traces 07:16 Backend demo (FastAPI) + live chat observability 08:44 Instrumenting FastAPI + SurrealDB with Logfire 09:29 What changed in the migration (schema, API layer, client) 10:35 MCP server setup (SurrealDB MCP) + why it helps 11:15 MCP in action: querying Logfire + SurrealDB 14:20 Evals intro (why, what) 15:07 Evals implementation (LLM-as-judge + deterministic) 16:27 Running evals locally + instrumenting runs 17:37 Reviewing eval results in Logfire 19:13 Wrap-up summary (dashboards, alerts, SQL) 19:51 Q&A --- Resources --- ☁️ Start free on Surreal Cloud: https://surrealdb.com/cloud 🎓 SurrealDB University: https://surrealdb.com/learn 📚 Docs: https://surrealdb.com/docs 🎩 Surrealist (GUI): https://surrealdb.com/surrealist ⭐️ GitHub: https://github.com/surrealdb/surrealdb --- What is SurrealDB? --- SurrealDB is an AI-native, multi-model database built in Rust that unifies document, graph, time-series, relational, geospatial and key-value data models into a single engine. Combined with powerful search and retrieval (vector, full-text, hybrid), real-time and event-driven capabilities, and Spectron - its persistent memory layer for AI agents - SurrealDB provides the complete context layer so that models run next to the data, context remains synchronised, and application logic stays simple and dependable. --- Connect --- 🐦 Twitter: https://twitter.com/surrealdb 👩💻 LinkedIn: https://www.linkedin.com/company/surrealdb/ 💬 Discord: https://discord.com/invite/surrealdb 🛍️ Merch: https://surrealdb.store/