Skip to content

Knowledge Graph — What It Is

The Knowledge Graph uses LLMs (OpenAI) to extract entities, decisions, relationships, and constraints from natural-language documents. Results are persisted to Neo4j for rich graph queries.

Given a document about authentication architecture, the KG extracts:

Entity: AuthService (component)
Entity: JWT (technology)
Entity: Session-based auth (option)
Relationship: AuthService USES JWT
Relationship: Team DECIDED_FOR JWT
Relationship: Team DECIDED_AGAINST Session-based auth

You can then query it via the kg_query MCP tool (GitHub Copilot or any MCP client):

kg_query(question: "What decisions were made about authentication?")
# → JWT was chosen over session-based auth for the authentication system
# → Reasons: statelessness, horizontal scaling, API compatibility

Extraction Pipeline: IN → FX → KX → GX

Section titled “Extraction Pipeline: IN → FX → KX → GX”
  1. IN — Chunks documents (semantic markdown splitting, ~16k chars/chunk)
  2. FX — LLM extracts raw entity-relationship triples per chunk
  3. KX — Canonicalizes entities and predicates into a consistent schema (30 predicate types)
  4. GX — Cross-document entity deduplication (exact + fuzzy merge)

This extraction pipeline is not currently exposed as a CLI or MCP command — it describes how the graph data model is structured. Today, IntentWeave’s KG tools are read-only querying (kg_query, kg_context, kg_impact, kg_entities, kg_doc_health, kg_schema) against a Neo4j instance you populate yourself.

Entity types: concept, decision, option, requirement, feature, component, technology, resource, role, risk, phase, constraint, question, tradeoff

Relationship types: CONTAINS, DEPENDS_ON, IMPLEMENTS, EXTENDS, CALLS, USES, DECIDED_FOR, DECIDED_AGAINST, SUPERSEDES, ENABLES, BLOCKS, RISKS, and more.

| Need | Use | |------|-----| | Find relevant files | CARI (free, fast) | | Check doc freshness | CARI (free, fast) | | Understand decisions and rationale | KG | | Trace impact of architectural changes | KG | | Query natural-language questions | KG | | Build RAG context for AI agents | KG |

| Dependency | Purpose | |-----------|---------| | Neo4j 5 | Graph storage (Docker recommended) | | OpenAI API key | LLM extraction + NL queries |

  • Try It — set up Neo4j and run your first extraction
  • CLI Reference — full command documentation