Your data is in tables.
Your AI needs a knowledge graph.
Vector search finds similar documents. Knowledge graphs answer who, what, and why. TypeGraph brings graph semantics to your existing database.
The Retrieval Problem
AI agents need more than similarity search
Vector Search
Finds documents that look similar based on embeddings.
"Find documents about project management"
Knowledge Graphs
Answer questions about relationships between entities.
"Who manages the team working on Project Alpha?"
Relational databases can store relationships. They can't efficiently traverse them. Graph databases can traverse them, but they're a whole new infrastructure to deploy and maintain.
TypeGraph gives you graph semantics on databases you already know.
Our Flagship Project
Introducing TypeGraph
The knowledge graph library for TypeScript. Define your ontology with Zod, query with a fluent builder, and run on SQLite or PostgreSQL.
Schema-First
Define your model once with Zod. TypeGraph generates your database schema, API validation, and TypeScript types automatically.
Graph on SQL
Semantic relationships on databases you already know. Start with SQLite for prototyping, scale to PostgreSQL for production.
AI-Native Retrieval
Structured semantic context that LLMs can reason about. Built for RAG pipelines and agent workflows from the ground up.
import { defineNode, defineEdge, defineGraph } from "typegraph";
import { z } from "zod";
// 1. Define your ontology
const Person = defineNode("Person", {
schema: z.object({ name: z.string(), role: z.string() })
});
const Project = defineNode("Project", {
schema: z.object({ name: z.string(), status: z.string() })
});
const worksOn = defineEdge("worksOn");
// 2. Query with full type safety
const results = await store.query()
.from("Person", "p")
.whereNode("p", p => p.role.eq("Engineer"))
.traverse("worksOn", "e")
.to("Project", "proj")
.select(ctx => ({ person: ctx.p.name, project: ctx.proj.name }))
.execute(); Use Cases
What you can build
TypeGraph shines wherever relationships matter more than rows.
Org Intelligence
"Who reports to Sarah?" becomes a multi-hop traversal. Map reporting chains, team structures, and cross-functional relationships.
Smart Permissions
"Manager of" implies "can approve expenses for." Define semantic rules once, and TypeGraph enforces them through transitive closure.
Contextual RAG
Retrieve documents with their relationships intact. Give your LLM structured context about what connects to what and why.
Product Catalog
Model complex product hierarchies, variants, and compatibility rules. "Works with," "replaces," and "requires" as first-class relationships.
Workflow Automation
Model processes as graphs. Track dependencies, prerequisites, and parallel execution paths. Query for bottlenecks and critical paths.
Recommendations
"People who work on similar projects also use..." Discover connections through shared relationships, not just collaborative filtering.
Knowledge Bases
Connect concepts, definitions, and examples. Build ontologies that AI can navigate to answer complex, multi-step questions.
Data Lineage
Track where data comes from and where it goes. Model transformations, dependencies, and impact analysis as traversable paths.
Agent Memory
Give AI agents structured memory they can query. Store observations, inferences, and learned relationships in a graph they can navigate.
Why TypeGraph
Graph semantics without the infrastructure tax
You shouldn't need a new database to model relationships.
The traditional approach
Graph databases
Separate infrastructure to deploy, monitor, and scale. New query language to learn. Data sync headaches with your main database.
RDF triple stores
Powerful but complex. SPARQL has a steep learning curve. Tooling is academic, not developer-friendly.
ORMs with relations
Good for simple joins, but no multi-hop traversal. No semantic rules like "implies" or "inverseOf." Just foreign keys.
The TypeGraph way
Use your existing database
SQLite for development, PostgreSQL for production. No new infrastructure to deploy. Your data stays where it is.
TypeScript-native
Fluent query builder with full autocomplete. Zod schemas you already know. Catch errors at compile time, not runtime.
Real graph semantics
Multi-hop traversal. Transitive closure. Semantic rules like "implies" and "inverseOf." Not just foreign keys with extra steps.
Works with your stack
Integrates with your existing data. Layer TypeGraph on top of tables you already have. Migrate incrementally, not all at once.
Coming Soon
TypeGraph Cloud
Deploy production-ready knowledge graphs in seconds. Managed storage, instant APIs, and team collaboration features.
Be the first to know when we launch. No spam, unsubscribe anytime.
How We Can Help
From open source tools to hands-on implementation support.
TypeGraph Open Source
The full-featured knowledge graph library for TypeScript. Define your ontology with Zod, query with a fluent builder, and run on SQLite or PostgreSQL.
Get Started →Enterprise Support
Priority support for teams building mission-critical applications with TypeGraph. SLAs, dedicated channels, and direct access to the core team.
Get in Touch →Consulting & Solutions
We help you design your ontology, build your RAG systems, and architect intelligent applications. From proof-of-concept to production.
Let's Talk →