GRIP Protocol Documentation
The comprehensive developer and architecture documentation for the Universal GraphRAG Interoperability Protocol.
Table of Contents
Overview & Architecture
GRIP (GraphRAG Interoperability Protocol) establishes the vendor-neutral wire protocol and tool surface for Graph-Augmented Retrieval Generation.
The Missing Middle Layer Problem
Prior to GRIP, every knowledge graph database (TigerGraph, Neo4j, Amazon Neptune, Memgraph) required proprietary query languages (GSQL, Cypher, openCypher, Gremlin) and bespoke RAG pipelines. LLMs were forced to generate complex graph query strings, leading to syntax hallucination, injection risks, and tight vendor lock-in.
Architectural Guarantees
- Live Database Execution: 100% of tools execute directly against connected enterprise graph engines without stubbed responses.
- Cryptographic Provenance (Contract 5): Every answer is tied to source vertex IDs and chunk hashes.
- Dynamic Token Bounding (Contract 8): Output text fits strictly within caller's token budget.
- Multi-Backend Federation (Contract 6): Single queries fan out across hybrid TigerGraph + Neo4j clusters.
Installation & Quickstart
GRIP is distributed as a lightweight Python package with optional backend extras.
1. Install via pip or pipx
# Core package (standard MCP tools + in-memory store)
pip install -U grip-protocol
# With TigerGraph Cloud adapter & Gemini LLM support (Recommended)
pip install "grip-protocol[tigergraph,llm]"
# Global CLI installation via pipx
pipx install "grip-protocol[all]"2. Configure Environment Variables
# .env file in your working directory
TIGERGRAPH_HOST="https://your-graph-endpoint.i.tgcloud.io"
TIGERGRAPH_USERNAME="tigergraph"
TIGERGRAPH_PASSWORD="your_password"
TIGERGRAPH_SECRET="your_secret_alias"
TIGERGRAPH_GRAPH_NAME="GraphragProtocol"
GOOGLE_API_KEY="AIzaSy..."
LLM_MODEL="gemini-2.5-flash"3. Verify Installation via CLI
# Check health of active backend
grip --help
# Launch in stdio transport mode (default for IDE agents)
grip --transport stdioCLI Command Reference
`grip-protocol` registers multiple binary entry points for convenience:grip, grip-mcp, grip-server, graphrag-mcp.
| Flag | Values | Description |
|---|---|---|
| --transport | stdio | streamable-http | sse | MCP communication transport. Default: stdio. |
| --host | IP address (e.g. 0.0.0.0) | Bind address for HTTP or SSE server. Default: 127.0.0.1. |
| --port | Port number (e.g. 8000) | Port for HTTP or SSE server. Default: 8000. |
| --help | -h, --help | Display usage summary and exit. |
Complete 50-Tool MCP Surface
Every tool returns valid JSON strings conforming to the official RFC wire specifications. Below is the full tool catalog:
graphrag_search— Auto-routed hybrid searchgraphrag_local_search— Multi-hop entity expansiongraphrag_global_search— Community summary searchgraphrag_hybrid_search— Vector + topology fusiongraphrag_entity— Entity lookup by ID or namegraphrag_path— Shortest path discoverygraphrag_neighborhood— K-hop neighbor subgraph
graphrag_schema— Complete vertex & edge typesgraphrag_entity_types— Vertex types with countsgraphrag_relationship_types— Edge definitionsgraphrag_sample— Sample entities for LLM context
graphrag_ingest— Document ingestion pipelinegraphrag_delete_document— Cascade reference deletion
graphrag_provenance— Cryptographic citation tracegraphrag_trajectory— Ordered traversal step replaygraphrag_sources— Deduplicated supporting documentsgraphrag_audit— Visited-not-cited leak audit
graphrag_similarity— Cosine embedding & Jaccardgraphrag_temporal_search— Date range filtered searchgraphrag_explain— Natural language why-retrievedgraphrag_diff— SubgraphContext delta comparisongraphrag_count— Entity count with attribute filtersgraphrag_group_by— Group entities by propertygraphrag_top_n— Top-N ranked by numeric propertygraphrag_stats_summary— Graph-level density & degree
graphrag_export_subgraph— GraphML / Cypher / JSON-LDgraphrag_batch— Parallel execution up to 25 callsgraphrag_watch— Event journal & mutation streamgraphrag_resolve_conflicts— Temporal contradiction resolvergraphrag_triage_query— RAG vs GraphRAG ROI classifiergraphrag_agent_investigate— Multi-step reasoning agent
Transport Protocols (stdio, HTTP, SSE)
GRIP implements all three official Model Context Protocol transports:
1. stdio Transport (Standard Input/Output)
Best for local desktop agents like Claude Code, Cursor, Windsurf, and Zed. The agent spawns the `grip` process and communicates over pipes.
grip --transport stdio2. Streamable HTTP Transport
Modern HTTP transport for remote microservices, multi-tenant agent gateways, and cloud deployment.
grip --transport streamable-http --host 0.0.0.0 --port 80003. SSE (Server-Sent Events) Transport
HTTP with a continuous server-push event stream for real-time graph mutations and streaming traversal events (Contract 7).
grip --transport sse --host 0.0.0.0 --port 8000Supported Graph Backends
GRIP uses a pluggable adapter architecture (`BaseGraphRAGAdapter`) supporting both production graph databases and local lightweight stores:
TigerGraph Cloud (Savanna)
PrimaryNative REST++ precompiled queries for multi-hop traversals, Jaccard similarity, and vector similarity search on 512-dim embedding vertices.
Neo4j (Cypher)
SupportedBolt driver adapter compiling Contract 1 retrieval and Contract 3 schema introspection into parameterized Cypher queries.
SQLite WAL Store
EmbeddedZero-dependency local persistence for metadata, job status, capability tokens, and mutation event journaling.
In-Memory Demo Adapter
TestingInstant offline testing adapter pre-loaded with sample ArXiv knowledge subgraphs for hermetic test suites.
Autonomous Agentic Harness
`graphrag_agent_investigate` runs an autonomous multi-step reasoning loop powered by Gemini 2.5 Flash and Automatic Function Calling (AFC).
Agentic Investigation Trajectory
- Hypothesis Formulation: Identifies seed entities and queries schema structure.
- Targeted Expansion: Traverses high-confidence relationships across up to 10 hops.
- Conflict Resolution: Evaluates contradictions using Contract 19 recency and citation weights.
- Extractive Synthesis: Formulates final grounded answer strictly backed by visited provenance paths.
Explore All 20 Wire Contracts in Detail
Review JSON schemas, architectural guarantees, and standards for all 20 contracts.