Most GraphRAG material is written for Python and assumes you can read the paper first. This blog took the other route: a working TypeScript implementation on one PostgreSQL database, written up as it was built. Eleven posts is enough that the order matters more than any single one, so this page is the order.

Everything below is implemented in graphrag-ts — graph, embeddings, communities and citations in the same Postgres instance, with pgvector for the vector side. Nothing here is pseudo-code dressed up as a tutorial; where an article says "the pipeline does X", X is in the repository.

1. Design the schema before you write the extractor

  • GraphRAG on PostgreSQL + TypeScript: design — the DDL shape, how relation edge weights are calculated and accumulated, the community detection and hierarchical summarisation pipeline, and where each GraphRAG concept lands as a table.

Read this one first even if you plan to change everything in it. Most of the later articles assume the tables described here.

2. Get documents in, and decide how they split

The section-parent matching described here is what makes step 4 possible, so do not skip the chunking rules.

3. Index: extraction, edges, communities, summaries

  • GraphRAG indexing pipeline in TypeScript — adaptive chunking, structured LLM extraction with a fallback path, weighted edge aggregation, recursive Leiden communities, summary persistence, and content-hash-based incremental updates.

4. Rebuild only what changed

  • GraphRAG incremental build in TypeScript — title and SHA-256 diffing, Markdown section-parent matching, the order updates must be applied in, explicit deletion semantics, and how edge weights accumulate across runs.

This is the article that separates a demo from something you can keep running daily. The failure mode it avoids — a small input change reshuffling every community — is the reason the diffing is this explicit.

5. Understand the community layer

Read it before tuning anything in steps 6–7: the global answer quality is bounded by the summaries here, not by the prompt.

6. Retrieval: local, then hybrid

  • GraphRAG Retrieval Implementation Guide — query intent parsing, multi-channel entity retrieval with Reciprocal Rank Fusion, neighbour expansion, community scoring, LLM filtering, and final answer synthesis.
  • GraphRAG hybrid retrieval in TypeScript — the shipped version: entity and topology recall, hybrid vector and keyword evidence, RRF community ranking, and evidence grounding in the returned result.

The second article is the one to copy from. The first is the map of the decisions that got there.

7. Global questions: Map-Reduce over communities

Token-budget arithmetic and retry semantics are the two places this step quietly breaks at scale; both articles spend their time there rather than on the prompt.

8. Ship it to an agent

An agent that receives an answer without evidence will assert it. Returning the excerpt is the design decision that makes the MCP surface usable rather than decorative.

A worked case end to end

  • PDF to knowledge graph, with page anchors — PDF blocks keep their page and bounding box, entities and claims land in PostgreSQL, retrieval walks the graph, and every fact in the finished brief either hits the PDF text layer or fails the build.

If you only read one article on this blog to judge whether the approach is useful, read that one. It is the pipeline pointed at a real document type with a verification step at the end.

Before you build any of it

One decision that runs through all of it

What this series does not cover

  • No benchmark comparison against naive vector RAG. The case article above shows a verification result on one document class; it is not an evaluation across corpora, and this blog has not run one.
  • Single-node PostgreSQL only. Nothing here is about sharding the graph or running the pipeline across several writers.
  • The Python implementations (Microsoft's and others) are referenced where the concepts overlap, but the code is TypeScript throughout.

Where it runs