SurrealDB’s new Kreuzberg tutorial shows you how to turn raw documents into an AI‑ready knowledge graph that lives inside a single SurrealDB 3.0 instance. In just a few commands you’ll parse text, generate vector embeddings, and query both relational and graph data without juggling multiple databases. It’s the fastest way to prototype RAG‑style agents today.
Why a Unified Multi‑Model Database Matters
AI agents need relational tables, graph traversals, and vector similarity searches all at once. When you rely on separate systems, you introduce latency, extra cost, and complex maintenance. SurrealDB combines these capabilities under one roof, letting you scale from edge devices to cloud clusters without schema drift.
Benefits for AI Agents
- Reduced latency: A single query can fetch a node, traverse its edges, and rank results by embedding similarity.
- Simplified ops: No more glue code or network hops between databases.
- Cost efficiency: One engine means lower infrastructure overhead.
Kreuzberg Parser: From Documents to Graph Nodes
Kreuzberg is a Rust‑based engine that extracts entities, attributes, and hierarchical sections from PDFs, markdown, or plain‑text files. The parser creates both document records for full‑text search and graph nodes for relationship queries.
Supported File Types
- PDF documents
- Markdown files
- Plain‑text files
Embedding Generation
After parsing, each node receives a vector embedding. These embeddings live alongside the graph data, enabling fast similarity look‑ups without a separate vector store.
One‑Click Deployment with the Docker Extension
The Docker Extension bundles SurrealDB into a single‑node container. Pull the extension, start the container, and run the provided surreal import script to load your parsed data.
Setup Steps
- Install the Docker Extension from Docker Desktop.
- Launch the SurrealDB container with the default settings.
- Execute
surreal importto ingest the Kreuzberg output. - Start querying with SurrealQL.
Performance Gains
Because everything runs inside one container, you avoid the network hops that plague multi‑database stacks. A single SurrealQL statement can retrieve a node, follow its edges, and perform a cosine similarity search—all in milliseconds.
Real‑World Use Cases and Community Feedback
Developers are already using the tutorial to prototype knowledge‑graph‑enhanced agents. One participant cut their setup time from a day to under an hour, thanks to the Docker‑based deployment.
Speeding Up Development
With a unified schema, you can add new node types on the fly without migrating data across stores. This flexibility lets you iterate quickly as project requirements evolve.
Evolving Data Models
The community notes that a single SurrealQL query can both retrieve related entities and perform embedding similarity searches, streamlining the codebase and reducing operational overhead.
If you’re looking to build a knowledge‑graph‑powered AI agent today, SurrealDB’s Kreuzberg tutorial offers a ready‑to‑run solution that eliminates the need for a five‑database stack.
