Skip to content

@anvia/neo4j ​

@anvia/neo4j adds schema-first GraphRAG for Neo4j 2026.01 and newer. It implements the provider-neutral contracts in @anvia/graph for managed raw-text ingestion, vector or hybrid retrieval, bounded traversal, provenance evidence, Agent tools, and graph exploration.

Install ​

bash
pnpm add @anvia/graph @anvia/neo4j @anvia/core zod

Two registration modes ​

  • A managed knowledge graph provisions Anvia labels, constraints, vector indexes, and optional full-text indexes. It supports document replacement and deletion.
  • An existing knowledge graph validates caller-owned indexes and exposes read-only retrieval. Application code keeps provisioning and writes.

Both modes require an explicit graph schema and explicit retrieval, traversal, and evidence policy. Use defineGraphSchema() for portable applications. defineNeo4jGraphSchema() remains available as a compatibility API.

Core flow ​

text
raw text -> ingestGraphText() or ingestGraphDocuments()
         -> chunk, extract facts, embed chunks/entities
         -> replace documents in one managed-graph transaction

query -> embed -> vector or hybrid seeds -> bounded traversal -> evidence

The convenience helpers perform model preparation before starting the database write. Advanced applications can call prepareGraphDocuments() and replaceDocuments() separately.

Next steps ​

Built for Anvia.