TypeGraph - The Knowledge Graph for TypeScript

TypeGraph

2 min read Original article ↗

v0.73.1 · Look Before You Write

Define your ontology with Zod. Query with a fluent builder. Extend it at runtime when your agents need more.

GraphUserPostGroupRoleZodTypes

Your schema is your database. Your types are your queries.

The graph lifecycle

Keep schema, search, reasoning, merge, and history in one typed system.

Look Before You Write

How an agent can find the rows that no longer fit a tightened schema and repair them without overwriting a person's edit, using store.describe(), validateStore(), and compareAndSet().

Read the post →

Merges That Wait

0.56, 0.67 and 0.68 let a reviewed graph merge wait a day for approval, survive a deploy, reopen in another process, and take input from an at-least-once queue without applying anything twice.

Read the post →

Schema Changes That Roll Back With Everything Else

A runtime schema change can now commit or roll back in the same transaction as the graph writes that need it, recorded history, and your own SQL.

Read the post →

What is TypeGraph?

TypeGraph is a TypeScript-first embedded knowledge graph library. It brings property graph modeling and practical ontology support to your existing SQLite or PostgreSQL database — define nodes and edges with Zod, query with a fluent TypeScript API, and keep graph and app data in one deployment.

Do I need a separate graph database to use TypeGraph?

No. TypeGraph runs on the SQL database you already have — SQLite or PostgreSQL — instead of a dedicated graph service. You can start on SQLite and move to PostgreSQL later without changing your graph definition.

Does TypeGraph support vector or hybrid search?

Yes. TypeGraph runs vector and hybrid (BM25 + vector) search across every backend it supports — pgvector and libSQL/Turso native vectors on PostgreSQL and SQLite respectively.

Can I change the schema at runtime?

Yes. TypeGraph supports runtime schema evolution, including agent-proposed changes submitted as JSON, without a redeploy. See the Graph Extensions guide for details.

Does TypeGraph support historical or temporal queries?

Yes. TypeGraph reconstructs valid-time and recorded-time history with bitemporal reads, which is useful for auditable agent memory, decision replay, and forensics.

What license is TypeGraph released under?

TypeGraph is open source under the MIT license.

Occasional updates on new features, guides, and releases. No spam.