AGENT SKILL

package-extensions

Build and diagnose GraphRAG lower-level package extensions: custom caches, storage and table providers, input readers, chunkers, vector stores and filters, LLM completion/embedding providers, tokenizers, metrics/retry/rate-limit/template factories, graph helpers, and indexing workflow factories.

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

01 前言 Front Matter

name
package-extensions
license
MIT
metadata
{ "disco-role": "operating" }
description
Build and diagnose GraphRAG lower-level package extensions: custom caches, storage and table providers, input readers, chunkers, vector stores and filters, LLM completion/embedding providers, tokenizers, metrics/retry/rate-limit/template factories, graph helpers, and indexing workflow factories.
disable-model-invocation
true

02 资源文件 5

03 SKILL.md 正文

GraphRAG Package Extensions

Use this sub-skill when the task mentions custom providers, factory registration, extension points, offline mocks, graph helper validation, vector-store filters, timestamp/date fields, chunkers, or low-level package diagnostics.

For user-facing YAML/config selection, route to ../configuration-data/. For indexing orchestration or running pipelines, route to ../indexing/. For query APIs and result-table requirements, route to ../querying/.

Core Pattern

GraphRAG package extensions usually follow the same pattern:

  1. Implement the package interface or subclass the base class.
  2. Register it under a stable string key with the package register_* function.
  3. Use the matching config model or create_* helper so GraphRAG instantiates it.
  4. Keep optional services behind explicit dependency and credential checks.

The shared factory base supports scope="transient" and scope="singleton". create() removes init args whose value is None, so use a sentinel or explicit default if an initializer must distinguish "unset" from None. Singleton instances are cached by strategy plus init args; avoid singleton scope for mutable per-run state unless the init args fully identify the state.

Common Extension Points

  • Cache: implement graphrag_cache.Cache, register with register_cache(type, initializer, scope="transient"), create with create_cache(CacheConfig(...), storage=...).
  • Storage: implement graphrag_storage.Storage, register with register_storage(type, initializer), create with create_storage(StorageConfig(...)).
  • Table provider: implement graphrag_storage.tables.TableProvider, register with register_table_provider(type, initializer), create with create_table_provider(TableProviderConfig(...), storage=...).
  • Input reader: subclass or implement graphrag_input.InputReader, register with register_input_reader(type, initializer), create with create_input_reader(InputConfig(...), storage).
  • Chunker: implement graphrag_chunking.Chunker, register with register_chunker(type, initializer), create with create_chunker(ChunkingConfig(...), encode=..., decode=...).
  • Vector store: subclass graphrag_vectors.VectorStore, register with register_vector_store(type, initializer), create with create_vector_store(VectorStoreConfig(...), IndexSchema(...)).
  • LLM providers: implement completion or embedding interfaces, register with register_completion or register_embedding; model config model_extra fields are passed through to initializers.
  • LLM utilities: tokenizer, retry, rate-limit, metrics store/processor/writer, template manager/engine factories have analogous register_* and create_* helpers.
  • Index workflows: register workflow callables with PipelineFactory.register(name, workflow) and methods with PipelineFactory.register_pipeline(name, [workflow_names...]).
  • Graph helpers: use deterministic DataFrame helpers such as compute_degree, connected_components, largest_connected_component, and stable_lcc for offline graph checks.

Recommended Workflow

  1. Identify the package boundary first: storage/cache/input/chunking/vector/LLM/graph/workflow.
  2. Inspect the initializer signature of the target base or built-in implementation.
  3. Decide factory scope: transient for fresh state, singleton only for shareable clients keyed by complete init args.
  4. Register a unique key before calling create_*; duplicate keys overwrite the previous initializer in the process.
  5. Create a tiny offline mock before adding optional cloud/database dependencies.
  6. Add a smoke check for --help, factory registration, and one deterministic operation.
  7. If wiring through GraphRAG config, move user-facing config guidance to ../configuration-data/.

Bundled Scripts

  • scripts/register_mock_extensions.py demonstrates offline custom storage, cache, input reader, vector store, and direct factory patterns.
  • scripts/validate_graph_helpers.py checks degree, connected components, stable LCC normalization/order, timestamp explosion, and filter expressions on deterministic in-memory data.

Both scripts are examples for future agents to copy or adapt inside their own workspace. They do not require external services.

References

  • references/factory-extension-recipes.md for concrete registration recipes and design notes.
  • references/package-optional-dependencies.md for guarded dependency and service guidance.
  • references/troubleshooting.md for factory, config, service, vector filter, and graph-helper failures.

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