create-retrieval-plugin
Skill149 starsChanged 8 months agoApache-2.0View on GitHub
Guide developers through creating a custom retrieval pipeline plugin for AutoRAG-Research. Walks through scaffolding, implementing BaseRetrievalPipeline methods, writing YAML configs, testing, and installing. Use when building a new search/retrieval strategy (e.g., Elasticsearch, ColBERT, custom vector search).
- Installs packages
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .codex/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- autorag-querySkill
- create-generation-pluginSkill
- create-ingestor-pluginSkill
- create-metric-pluginSkill
- refactorSkill
- resolve-conversationSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 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.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 25
Read the generated pipeline.py, pyproject.toml, YAML config, and test file to understand the structure.
- Very specific: line 47
Custom parameters: Add fields to your config class and pass them via get_pipeline_kwargs() → accept them in the pipeline constructor.
≈ “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.
Files
Create Retrieval Plugin
Workflow
1. Scaffold
autorag-research plugin create my_search --type=retrievalRead 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.mdai_instructions/pipeline_test_writer.mdai_instructions/pipeline_architecture_mapper.md
Implement the two abstract methods in the pipeline class:
_retrieve_by_id(query_id, top_k)— retrieve using query ID (query exists in DB with stored embedding)_retrieve_by_text(query_text, top_k)— retrieve using raw text (may need on-the-fly embedding)
Both must return list[dict[str, Any]] with doc_id (chunk ID) and score keys.
DO NOT add your own
asyncio.gather,asyncio.Semaphore, or any concurrency control. The base pipeline'srun()already handles parallel execution of all queries viarun_with_concurrency_limit()(semaphore + gather), controlled by themax_concurrencyconfig parameter. Your method is called once per single query — just implement the retrieval 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. See bm25.py for a real example.
3. Write tests and install
cd my_search_plugin
pip install -e . # or: uv pip install -e .
cd .. && autorag-research plugin syncVerify: ls configs/pipelines/retrieval/my_search.yaml
Key Files
| Purpose | Path |
| Base config class | autorag_research/config.py → BaseRetrievalPipelineConfig |
| Base pipeline class | autorag_research/pipelines/retrieval/base.py → BaseRetrievalPipeline |
| Service layer | autorag_research/orm/service/retrieval_pipeline.py → RetrievalPipelineService |
| Plugin entry point discovery | autorag_research/plugin_registry.py |
Examples
Study these existing implementations for patterns:
autorag_research/pipelines/retrieval/bm25.py— BM25 retrieval (simple)autorag_research/pipelines/retrieval/vector_search.py— Vector similarity searchautorag_research/pipelines/retrieval/hybrid.py— Hybrid (BM25 + vector)autorag_research/pipelines/retrieval/hyde.py— HyDE (Hypothetical Document Embeddings)- YAML configs:
configs/pipelines/retrieval/bm25.yaml,configs/pipelines/retrieval/vector_search.yaml
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
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.

