add-rag-source
Add a new document source into the HybridRetriever knowledge base in agentic-platform.
- License 许可
- MIT
- 最近更新
- 2026-09-21
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- add-rag-source
- description
- Add a new document source into the HybridRetriever knowledge base in agentic-platform.
03 SKILL.md 正文
Add a new RAG data source
Use this when asked to ingest a new document/knowledge source into the retrieval pipeline.
Steps
-
Chunk the source with
chunk_document(doc_id, text, source=..., chunk_size=200, overlap=40)fromsrc/agentic_platform/rag/pipeline.py. Keepchunk_size > overlap(enforced by aValueErrorotherwise). Choose a stable, human-readabledoc_id— it's used as a provenance key. -
Index it via
HybridRetriever.index(chunks). If you're wiring a new ingestion path (e.g. reading from a directory, a database, or an API), add it as a method on a small ingestion helper — don't inline file/DB reads insideAgenticPipeline. KeepHybridRetrieverfree of any knowledge of where text came from; it only knows aboutChunkobjects. -
If replacing the embedding backend: the current
_hash_embeddinginrag/pipeline.pyis a deterministic, dependency-free stand-in for a real embedding model. To swap in a real model (OpenAI/Voyage/Cohere embeddings), replace_hash_embeddingand_tokenize's role, but keep theHybridRetrieverpublic interface (index,retrieve,size) unchanged so the rest of the codebase (agents, tests) doesn't need to change. -
Write tests:
- Unit test that chunking produces the expected chunk count/boundaries for your new source's typical document length.
- Unit or integration test that a representative query against the new source ranks the relevant chunk in the top-k.
-
Consider retrieval quality, not just plumbing: if your source has exact-match identifiers (SKUs, ticket IDs, error codes), verify the lexical scoring component (not just dense/embedding scoring) surfaces them — this is exactly what hybrid retrieval is for.
-
Run
make cibefore considering the task done.
04 同仓库更多 Skills
write-tests-100-coverage
Write tests that keep agentic-platform at 100% branch coverage without gaming the metric.
add-rag-source
Add a new document source into the HybridRetriever knowledge base in agentic-platform.
add-fastapi-endpoint
Add a new endpoint to the agentic-platform FastAPI service in src/agentic_platform/api/main.py.
add-agent-node
Add a new node (agent role) to the multi-agent SimpleGraph in agentic-platform, with routing and tests.
write-tests-100-coverage
Write tests that keep agentic-platform at 100% branch coverage without gaming the metric.
add-fastapi-endpoint
Add a new endpoint to the agentic-platform FastAPI service in src/agentic_platform/api/main.py.