RAG + Graph + Memory
An MIT-licensed TypeScript context layer backed by Postgres and pgvector.
Runs in your stack
TypeGraph is MIT-licensed and runs in your application against Postgres and pgvector.
One SDK, one path, one Postgres database. Stop stitching together fragmented context pipelines, memory systems and multiple databases.
Send your data, search it with hybrid retrieval, and build persistent memory for your agents. TypeGraph is a focused primitive - it stores, indexes, and retrieves so you can focus on building.
Vectors · Documents · Graph
One SDK for ingest, retrieval, and memory
Connect any data source, chunk and embed content automatically, and retrieve the most relevant context for your LLMs with a single unified interface.
Flexible by Design
Whether you're building a simple RAG application, or need a full-featured enterprise solution, TypeGraph is flexible enough to meet your needs. Ingest documents with automatic chunking, embedding, and deduplication. Content-hash-based change detection means re-ingesting is cheap - only new or modified content gets processed.

Observability
Open Telemetry-based metrics, tracing, health dashboard, session replay, temporal explorer ("what did the agent know when?"), memory influence tracking, query performance analytics and more.

Secure and Private
Built in scope isolation. Encryption at rest and in transit. Easily configure least-privilege PostgreSQL permissions for self-hosted TypeGraph deployments.

Typeless Buckets
Named containers that organize your data without rigid schemas. A single bucket can hold documents, events, and memory artifacts from any provider or format.
Content Deduplication
Hash-based change detection across ingestion runs. Re-ingest your entire corpus and only new or modified content gets processed and embedded.
Context Assembly
Assemble chunks, facts, entities, and memories into LLM-ready context with section controls, token budgets, and XML/markdown formatting built in.
Multi-tenancy
Built-in tenant isolation via tenantId scoping. Every document, event, memory, and search is automatically filtered to the correct tenant.
Knowledge Graph
Automatic entity extraction and relationship linking from documents, events, and thread turns. Search the semantic graph to surface connections your agents wouldn't otherwise find.
Temporal Memory
Temporal memory with automatic entity extraction, knowledge graph construction, and recency scoring. Your agents remember prompt context across sessions and threads.
Intelligent Embeddings
Use any AI SDK-compatible embedder - OpenAI, Cohere, local ONNX models, and more. Configure separate ingest and search embedders when your provider supports asymmetric retrieval.
Cognitive Memory for AI Agents
Give your agents persistent, structured memory that grows with every interaction.
Episodic
Timestamped events with session context. Auto-extracted from conversations. Decays naturally over time.
Semantic
Subject-predicate-object fact triples. Contradiction detection and resolution. Knowledge graph relationships.
Procedural
Learned procedures from repeated patterns. Tracks success/failure rates. Promotes reliable patterns.
Knowledge Graph Intelligence
Automatically extract entities and relationships from your data. Visualize connections, discover patterns, and query your knowledge graph to surface insights.
Ingestion
Documents, events, threads, and structured data are automatically processed. Entity extraction identifies people, organizations, concepts, and more from unstructured text.
Extraction
Relationships between entities are automatically identified and linked. Subject-predicate-object triples form a semantic network that grows with every interaction.
Query
Traverse the graph to find connections your agents wouldn't otherwise discover. Combine graph traversal with vector search for context-aware retrieval.
Start building with TypeGraph today
Install the MIT-licensed SDK, connect Postgres with pgvector, and keep your context layer in your own stack.