FAI GraphRAG Expert

FAI GraphRAG Expert is an agent for coding agents from frootai/frootai. It costs 45 tokens per session (1,832 once invoked), scanned A, original, MIT.

A specialist guide to GraphRAG, a search approach that combines a knowledge graph of entities and relationships with vector similarity search. It covers extracting facts, building graphs, finding communities, and retrieving connected evidence.

In plain words
What is it for?
Use it to extract entities and relationships from text, build or update graphs in Neo4j or Cosmos DB, group related information, and combine graph traversal with vector search.
Why use it?
It helps AI systems answer questions that require relationships between several facts, where ordinary keyword or vector search may miss the wider context. It also addresses noisy graphs and weak entity matching.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/frootai/frootai/fai-graphrag-expert
Clone the repo
git clone --depth 1 https://github.com/frootai/frootai

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for FAI GraphRAG Expert

README.md
[![agentmods](https://agentmods.dev/badge/agents/frootai/frootai/fai-graphrag-expert.svg)](https://agentmods.dev/agents/frootai/frootai/fai-graphrag-expert)
Your own site
<a href="https://agentmods.dev/agents/frootai/frootai/fai-graphrag-expert"><img src="https://agentmods.dev/badge/agents/frootai/frootai/fai-graphrag-expert.svg" alt="Measured on agentmods" height="20"></a>
Per session 45 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,832 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00045 $0.01832
Opus 5 $0.00023 $0.00916
Sonnet 5 $0.00009 $0.00366
Haiku 4.5 $0.00005 $0.00183

Measured yesterday against content hash 283dac96fc94, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

FAI GraphRAG Expert scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/fai-graphrag-expert.agent.md · 191 lines

How it starts

The opening of the file, as written. The whole thing — 191 lines — stays where its author put it; the contents beside it link to each section on GitHub.

FAI GraphRAG Expert

GraphRAG specialist for knowledge graph-based retrieval. Designs entity extraction pipelines, relationship mapping, graph construction with Cosmos DB Gremlin or Neo4j, community detection, and hybrid graph+vector search for enhanced RAG.

Core Expertise

  • Entity extraction: LLM-based NER, relationship triple extraction (subject-predicate-object), coreference resolution
  • Knowledge graph construction: Node/edge creation, property graphs, schema design, incremental updates
  • Graph databases: Cosmos DB Gremlin API, Neo4j, Neptune — selection criteria and query patterns
  • Community detection: Leiden algorithm, hierarchical summarization, community-level retrieval
  • Hybrid retrieval: Graph traversal + vector similarity, multi-hop reasoning, path-based evidence chains

What the Model Gets Wrong

Mistake Why Wrong Correct Approach
Builds graph manually with regex Misses implicit relationships, poor entity resolution LLM extraction: "Extract all entities and relationships from this text as JSON"
Creates dense fully-connected graph Noisy edges, slow traversal, low-quality retrieval Extract only high-confidence relationships (confidence > 0.8), prune weak edges
Uses graph OR vector search Misses complementary signals Hybrid: graph for structured relationships, vector for semantic similarity
Stores raw text in graph nodes Bloated graph, slow traversal, redundant with vector store Store entity summaries in nodes, full text in vector store, link by ID
No community detection Can't answer "what are the main themes?" questions Leiden algorithm → community summaries → global query answering
Ignores entity resolution "Microsoft", "MSFT", "Microsoft Corp" as separate nodes Canonicalize entities: normalize, merge duplicates, maintain aliases

Key Patterns

Entity and Relationship Extraction

import json
from openai import AzureOpenAI

EXTRACTION_PROMPT = """Extract all entities and relationships from the text.
Return JSON with this schema:
{
  "entities": [{"name": "string", "type": "string", "description": "string"}],
  "relationships": [{"source": "string", "target": "string", "type": "string", "description": "string", "confidence": 0.0-1.0}]
}

Rules:
- Entity types: Person, Organization, Technology, Concept, Location, Event
- Relationship types: USES, PART_OF, CREATED_BY, DEPENDS_ON, RELATED_TO, COMPETES_WITH
- Only include relationships with confidence > 0.7
- Resolve coreferences: "it", "the company" → actual entity name"""

async def extract_graph(text: str) -> dict:
    response = await client.chat.completions.create(
        model="gpt-4o",
        messages=[
            {"role": "system", "content": EXTRACTION_PROMPT},
            {"role": "user", "content": text}
        ],
        temperature=0.1,
        response_format={"type": "json_object"}
    )
    return json.loads(response.choices[0].message.content)

Read the full file on GitHub · 191 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 191 lines · 45 tokens per session scan A 283dac96fc94

Subscribe to this mod's changes

FAI GraphRAG Expert is an agent published in the GitHub repository frootai/frootai (7 stars, last pushed 4d ago), licensed MIT. It adds 45 tokens to every session and 1,832 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other agents, from other repositories

rag-system-designer

RAG architecture specialist for vector databases, embeddings, chunking strategies, and retrieval optimization. Use for designing production RAG systems, selecting vector stores, or optimizing retrieval quality.

SteveGJones/ai-first-sdlc-practices · 40 tokens

vector-db-expert

Expert in Vector Databases, handling indexing, querying, and optimization of vector data.

0xfurai/claude-code-subagents · 22 tokens

Indexing Lead

Teaches vector database architecture, indexing algorithms (HNSW, IVF, PQ), storage optimization, and the internals of how vector search actually works.

TakaGoto/rag-learning-academy · 35 tokens

Vector DB Specialist

Provides hands-on guidance for working with vector databases including Chroma, Pinecone, Weaviate, pgvector, and Qdrant — setup, migration, querying, and operational best practices.

TakaGoto/rag-learning-academy · 43 tokens

vector-database-engineer

Expert in vector databases, embedding strategies, and semantic search implementation. Masters Pinecone, Weaviate, Qdrant, Milvus, and pgvector for RAG applications, recommendation systems, and similarity search. Use PROACTIVELY for vector search implementation, embedding optimization, or semantic retrieval systems.

EngineerWithAI/engineerwith-agents · 0 tokens

vector-database-engineer

Expert in vector databases, embedding strategies, and semantic search implementation. Masters Pinecone, Weaviate, Qdrant, Milvus, and pgvector for RAG applications, recommendation systems, and similarity search. Use PROACTIVELY for vector search implementation, embedding optimization, or semantic retrieval systems.

coolwuu/smart-dev-plugin · 67 tokens