Who This Book Is For
You're building AI agents. Real ones—systems that need to reason over complex relationships, make decisions based on interconnected facts, and remember what matters. You've hit the limits of flat schemas and embeddings alone. You need structure that captures meaning without becoming a maintenance nightmare.
This book is for you if you're an AI engineer, ML architect, or fullstack developer who recognizes that knowledge representation isn't optional—it's foundational. You work with language models, multi-agent systems, or semantic applications. You've probably struggled with ontology design, or wondered whether a graph database could actually work on-device. You want to understand
*why*
TypeDB matters for agents, not just how to use it.
You don't need to be a database expert. You don't need a background in formal logic. What you do need is curiosity about how systems reason, patience for the details that matter, and the desire to build smarter agents.
## What This Book Is About
This isn't a reference manual. It's a journey through the ideas that make TypeDB different, followed by practical mastery of how to use it for real agent applications.
We start with the
*why*
—understanding Russell's Paradox and the type theory that prevents databases from collapsing under their own logical weight. We examine how agents need ontologies, not just data. We look inside TypeDB's architecture and why the Rust rewrite in version 3.0 makes edge deployment feasible.
Then we get hands-on. You'll install TypeDB, learn the PERA model (one of the few genuine innovations in knowledge representation), and master dependent types—a concept borrowed from formal verification that gives you guarantees most databases can't dream of. We'll dig into TypeQL as a language, not just a query syntax. We'll build knowledge graphs that stay coherent, model ontologies that don't compromise correctness for convenience, and design structures beyond the typical graph patterns.
Finally, we push further. Hypergraphs and metagraphs aren't just abstract—they're essential for capturing the complexity of real agent systems. We apply all of this to the problems that matter: building semantic memory that agents can actually trust, designing spacetime models for temporal reasoning, and implementing promise graphs to coordinate multi-agent behavior.
Throughout, the emphasis is on understanding
what you're doing
and
why it works
. Every pattern, every design choice, every constraint—it all serves clarity and correctness.
What You Will Learn
You'll gain a deep understanding of type theory as it applies to knowledge representation. Not the mathematical abstraction, but the practical intuition—why dependent types prevent certain classes of bugs, how TypeDB's constraint system differs from SQL's, and when you actually need these guarantees.
You'll master the PERA model and learn why it replaces the tired entity-relationship model for modern systems. You'll understand polymorphism and inheritance in TypeDB, and how they differ fundamentally from inheritance in object-oriented languages. TypeQL will stop being a syntax to memorize—you'll understand its design principles and how to write queries that express exactly what you mean.
You'll learn to design knowledge graphs that scale without becoming incoherent. You'll model OWL ontologies in TypeDB and understand what OWL can and cannot express. You'll go beyond OWL and SHACL when they constrain your design instead of serving it. You'll grasp hypergraphs and metagraphs well enough to know when they're the right choice—and when they're overengineering.
Most importantly, you'll learn to build AI agent systems grounded in sound knowledge representation. You'll design semantic memory that agents can query with confidence. You'll implement temporal reasoning without pretending it's simpler than it is. You'll coordinate multi-agent behavior using promise graphs—a pattern that's emerging as essential for real-world agent systems.
How This Book Is StructuredPart I: Why TypeDB
Part I: Why TypeDB establishes the foundations. We begin with Russell's Paradox and type theory—the ideas that make all subsequent chapters coherent. We compare TypeDB to other databases so you understand what trade-offs we're making. We examine why agents need ontologies and dive into TypeDB's internals. We close this part with the Rust rewrite and what edge deployment means for your systems.
Part II: Hands-On Essentials teaches you to work fluently with TypeDB. Installation and initial setup. The PERA model—a proper understanding of how to think about entities, relations, attributes, and roles. Polymorphism and inheritance in a database context. A thorough journey through TypeQL. Dependent types and why they matter. Type theory grounded in practice. The open world and closed world assumptions and when each is right for your problem.
Part III: Knowledge Representation tackles the hard problems. Knowledge graphs at scale. OWL ontology modeling in TypeDB. When and how to move beyond OWL and SHACL to capture constraints that standard languages can't express.
Part IV: Advanced Structures explores patterns for complex systems. Hypergraphs—structures where edges connect more than two vertices—and when they clarify your domain. Metagraphs—graphs whose nodes and edges are themselves subject to the rules of the domain—and how they enable self-referential reasoning.
Part V: Applications brings everything together. Building semantic memory for AI agents that doesn't degrade over time. Semantic spacetime for temporal and spatial reasoning. Promise graphs—a pattern for distributed multi-agent coordination that respects causality and consistency.
About the Author
Volodymyr Pavlyshyn is a graph database architect with two decades in systems where structure matters. He started at TomTom building geographic data systems where accuracy was non-negotiable. From there, he moved into decentralized identity and self-sovereign systems—work that taught him how to reason about trust and verification in distributed contexts.
Most recently, Volodymyr spent two years at Kin building conversational memory for a personal AI agent that ran entirely on-device. That experience—living with the constraints of embedded systems, watching how agents actually fail when memory degrades, understanding what "knowing something" really means—is what drove his deeper research into graph databases and knowledge representation.
He describes himself as an architect who stays hands-on. He's built databases, shipped production systems, reviewed architecture decisions that went wrong, and learned from all of it. When Volodymyr writes about TypeDB and agent systems, he's writing from hard experience, not theory alone.
Outside of work, Volodymyr loves graphs (the mathematical kind and the diagram kind), cats, and his wife Liliia—who has learned more about ontologies than she probably ever wanted to know.