agentleFS
NomaDamasNomaDamas/AutoRAG-Research/.agents/skills/create-generation-plugin/SKILL.md

create-generation-plugin

Skill149 starsChanged 8 months agoApache-2.0View on GitHub

Guide developers through creating a custom generation pipeline plugin for AutoRAG-Research. Walks through scaffolding, implementing BaseGenerationPipeline methods, composing with retrieval pipelines, writing YAML configs, testing, and installing. Use when building a new RAG generation strategy (e.g., chain-of-thought RAG, multi-hop RAG).

  • Installs packages

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read the generated pipeline.py, pyproject.toml, YAML config, and test file to understand the structure.

    line 25
  2. Very specific:

    Must return a GenerationResult(text=...) (from autorag_research.orm.service.generation_pipeline).

    line 41
  3. Very specific:

    Custom parameters: Add fields to your config class and pass them via get_pipeline_kwargs() → accept them in the pipeline constructor.

    line 49
  4. Very specific:

    Use langchain_core.language_models.FakeListLLM to mock the LLM in tests.

    line 57

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Create Generation Plugin

Workflow

1. Scaffold

autorag-research plugin create my_rag --type=generation

Read the generated pipeline.py, pyproject.toml, YAML config, and test file to understand the structure.

2. Implement

For the shared pipeline implementation and testing rules, read:

  • ai_instructions/pipeline_implementer.md
  • ai_instructions/pipeline_test_writer.md
  • ai_instructions/pipeline_architecture_mapper.md

Implement the _generate(query_id, top_k) method. This is where your RAG strategy lives.

Available attributes inside the pipeline:

  • self._llm — LangChain BaseLanguageModel (use await self._llm.ainvoke(prompt))
  • self._retrieval_pipeline — composed retrieval pipeline (use await self._retrieval_pipeline._retrieve_by_id(query_id, top_k))
  • self._service — GenerationPipelineService (use self._service.get_chunk_contents(chunk_ids), self._get_query_text(query_id))

Must return a GenerationResult(text=...) (from autorag_research.orm.service.generation_pipeline).

DO NOT add your own asyncio.gather, asyncio.Semaphore, or any concurrency control. The base pipeline's run() already handles parallel execution of all queries via run_with_concurrency_limit() (semaphore + gather), controlled by the max_concurrency config parameter. Your _generate method is called once per single query — just implement the retrieve-and-generate logic for that one query.

Custom parameters: Add fields to your config class and pass them via get_pipeline_kwargs() → accept them in the pipeline constructor.

Inherited config fields (from BaseGenerationPipelineConfig):

  • llm — LLM model string (auto-converted to LangChain model instance)
  • retrieval_pipeline_name — name of the retrieval pipeline to compose with (Executor injects it)

3. Write tests and install

Use langchain_core.language_models.FakeListLLM to mock the LLM in tests.

cd my_rag_plugin
pip install -e .   # or: uv pip install -e .
cd .. && autorag-research plugin sync

Verify: ls configs/pipelines/generation/my_rag.yaml

Key Files

PurposePath
Base config classautorag_research/config.py → BaseGenerationPipelineConfig
Base pipeline classautorag_research/pipelines/generation/base.py → BaseGenerationPipeline
Service + GenerationResultautorag_research/orm/service/generation_pipeline.py
Plugin entry point discoveryautorag_research/plugin_registry.py

Examples

Study these existing implementations for patterns:

  • autorag_research/pipelines/generation/basic_rag.py — Simple retrieve-then-generate (start here)
  • autorag_research/pipelines/generation/ircot.py — Interleaving retrieval with chain-of-thought
  • autorag_research/pipelines/generation/et2rag.py — Entity-aware RAG
  • autorag_research/pipelines/generation/main_rag.py — Main RAG pipeline
  • YAML configs: configs/pipelines/generation/basic_rag.yaml, configs/pipelines/generation/ircot.yaml

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.