AGENT SKILL

nano-graphrag

Use nano-graphrag for lightweight GraphRAG indexing, querying, provider customization, storage backend selection, prompt/entity extraction tuning, and troubleshooting.

License 许可
MIT
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
nano-graphrag
license
MIT
metadata
{ "disco-role": "operating" }
description
Use nano-graphrag for lightweight GraphRAG indexing, querying, provider customization, storage backend selection, prompt/entity extraction tuning, and troubleshooting.
disable-model-invocation
true

02 资源文件 5

03 SKILL.md 正文

nano-graphrag

Use this repo skill when a task involves the nano-graphrag Python package, lightweight GraphRAG/RAG indexing, graph-backed retrieval, local/global/naive query modes, custom LLM or embedding providers, storage backend swaps, entity-extraction troubleshooting, or GraphML knowledge graph inspection.

The root stays a router. Open the focused sub-skill for the workflow you need, then use its bundled references and scripts instead of reopening the source repository.

Quick environment check

Install the package in the active project environment with one of:

pip install nano-graphrag
# or, for a checkout you are actively editing:
pip install -e .

Then verify importability:

from nano_graphrag import GraphRAG, QueryParam
print(QueryParam(mode="global"))

If import fails with ModuleNotFoundError: No module named 'transformers', install transformers; this repository version imports transformers.AutoTokenizer at module import time even though the package metadata may not list it explicitly.

Run scripts/check_nano_graphrag_env.py when you need a safe no-network import/API/storage sanity check before following deeper recipes.

Route by task

User task Read first
Build a GraphRAG, insert text, query global/local/naive modes, use async methods, reuse a working_dir, or validate custom chunking. sub-skills/core-graphrag-workflows/SKILL.md
Replace OpenAI with Azure OpenAI, Amazon Bedrock, DeepSeek/OpenAI-compatible APIs, Ollama, local embeddings, or debug provider kwargs/credentials. sub-skills/provider-and-model-integrations/SKILL.md
Choose JSON/NanoVectorDB/HNSW/NetworkX/Neo4j storage, adapt FAISS/Milvus/Qdrant-style vector stores, or visualize GraphML. sub-skills/storage-backends/SKILL.md
Change prompts, repair malformed JSON, customize entity extraction/DSPy, or recover from zero entities / empty graph / Leiden failures. sub-skills/customization-and-troubleshooting/SKILL.md

Read these root references

  • Read references/package-overview.md for package purpose, public API surface, default components, install caveats, and how the sub-skills fit together.
  • Read references/troubleshooting.md for cross-cutting install/import, provider, storage, empty-graph, and optional dependency triage before choosing a deeper troubleshooting page.
  • Read references/repo-provenance.md before deciding whether this skill is current for a checkout or whether refresh-repo-skill is needed.
  • references/repo-routing-metadata.json is structured metadata consumed by the repo-skills router import process; do not edit it casually.

High-confidence operating rules

  1. Use a stable working_dir for persistent state. The default local stack writes JSON KV stores, NanoVectorDB JSON files, and NetworkX GraphML under that directory.
  2. Do not run hosted-provider examples until credentials, network policy, model IDs, and rate limits are explicit. For no-network validation, use fake LLM/embedding helpers from the core sub-skill.
  3. Enable enable_naive_rag=True before insertion if you will later query QueryParam(mode="naive").
  4. Treat Neo4j, Ollama, Bedrock, FAISS, Milvus, Qdrant, and downloaded local embedding models as optional integrations with their own services, packages, or credentials.
  5. If insertion produces no entities/relations, debug provider output format and context length before replacing graph storage.
  6. Keep any generated application scripts independent of this source checkout; copy or adapt needed patterns into the application or use the bundled scripts here.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351