Self-Hosted Initialization
Configure TypeGraph in self-hosted mode with pgvector, separate ingest/search embedders, an LLM, and ontology config.
Install Packages
Self-hosted TypeGraph needs the SDK, the pgvector adapter, a database client, and whichever AI SDK provider you use for embeddings and extraction.
Build the Config
The end-state self-hosted config is tenantId + vectorStore + embedding + searchEmbedding + llm + ontology. embedding is used for ingest. searchEmbedding is optional but lets you use a separate search embedder in the same vector space.
Deploy Then Init
typegraphDeploy() provisions tables, extensions, and indexes. typegraphInit() creates the runtime client. Run deploy during setup or migrations; use init on normal application boot.
Production Factory
Create one client per customer tenant. Tenant ID is the hard graph boundary; organization IDs from your app or Cloud auth should not be reused as the TypeGraph tenant unless that is truly your customer graph boundary.
Optional Custom Extractor
If extractor is omitted, TypeGraph builds its default extractor from llm and ontology. Advanced self-hosted users can provide a custom extractor as long as it accepts the expected input and returns the expected extraction result.