Works with the AI Agents you already use

    Production RAG Application Builder

    by Shahzaib Arshad

    1

    Build a practical Python RAG application with modular architecture, reliable retrieval, grounded answers, evaluation, and deployment guidance.

    Free

    Security scanned
    Production RAG Application Builder

    Production RAG Application Builder

    Example session with this skill installed

    I need to build a RAG app using FastAPI and Pinecone for 1,000 internal PDF manuals. Show me the project structure and an ingestion script that handles metadata.

    • Read your context and instructions
    • Compiled the production rag application

    I will design a modular RAG application for your PDF manuals using FastAPI and Pinecone, focusing on metadata preservation and clear separation of concerns.

    RAG Project Architecture

    The structure separates the Pinecone adapter from the document processing logic to ensure you can swap components later without refactoring the core API.

    
    # ingestion/processor.py
    import uuid
    from typing import List, Dict
    from langchain.text_splitter import RecursiveCharacterTextSplitter
    
    class DocumentProcessor:
        def __init__(self, chunk_size: int = 1000, chunk_overlap: int = 100):
            self.splitter = RecursiveCharacterTextSplitter(
                chunk_size=chunk_size,
                chunk_overlap=chunk_overlap
            )
    
        def process(self, text: str, metadata: Dict) -> List[Dict]:
            """Cleans text and creates chunks with preserved metadata."""
            chunks = self.splitter.split_text(text)
            processed_docs = []
            for i, chunk in enumerate(chunks):
                processed_docs.append({
                    "id": str(uuid.uuid4()),
                    "text": chunk,
                    "metadata": {
                        **metadata,
                        "chunk_index": i,
                        "source": metadata.get("filename")
                    }
                })
            return processed_docs
    
    # adapters/vector_store.py
    import pinecone
    from typing import List, Dict
    
    class PineconeAdapter:
        def __init__(self, api_key: str, index_name: str):
            self.index = pinecone.Index(index_name)
    
        def upsert_documents(self, documents: List[Dict], embeddings: List[List[float]]):
            vectors = [
                (doc["id"], emb, doc["metadata"])
                for doc, emb in zip(documents, embeddings)
            ]
            self.index.upsert(vectors=vectors)
    

    Next steps

    1. Initialize your Pinecone index with the correct dimensions for your chosen embedding model.
    2. Configure your .env file with PINECONE_API_KEY and OPENAI_API_KEY.
    3. Run the ingestion script on a small batch of 5 PDFs to verify metadata filtering.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Building a RAG application often leads to a tangled mess of brittle scripts, leaking abstractions, and ungrounded hallucinations. This skill helps you architect a maintainable Python RAG system from ingestion to deployment. It enforces modular design to ensure your retrieval logic, embedding providers, and vector stores remain swappable and testable.

    What it does

    • Architectural design defines a modular structure separating ingestion, chunking, storage, and generation.
    • Robust ingestion implements structured text cleaning, metadata preservation, and error handling for various file formats.
    • Retrieval optimization configures similarity search, metadata filtering, and citation handling.
    • Evaluation strategy generates tests for retrieval recall and answer faithfulness using representative datasets.
    • Deployment readiness provides FastAPI integration, environment configuration, and logging setup.

    How it works

    1. Discovery phase establishes your document types, corpus size, security requirements, and preferred LLM providers.
    2. Modular scaffolding generates a project structure using typed interfaces and adapter patterns.
    3. Pipeline implementation builds the ingestion and retrieval logic based on your specific metadata needs.
    4. Validation and testing executes unit tests for chunking and mock-based tests for vector store integration.

    Frameworks & tools

    Primarily targets Python 3.9+ environments. Works with FastAPI for API layers, standard vector databases, and various embedding or LLM providers.

    Why this beats prompting it yourself

    Standard prompts often produce monolithic scripts that break when you switch providers or scale your document library. This skill enforces strict separation of concerns and production-ready security patterns like authorization-aware retrieval and input sanitization that generic LLM requests typically omit.

    Use cases

    • Build a document Q&A system from scratch with citations.
    • Migrate a RAG prototype from a local script to a FastAPI microservice.
    • Implement evaluation metrics to measure answer quality and retrieval relevance.
    • Add multi-tenant document isolation to an existing retrieval pipeline.

    Known limitations

    Does not provide automated infrastructure provisioning or managed cloud hosting setup. Requires manual human review for final evaluation metrics and threshold tuning.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free to use

    No account required to browse

    Frequently Asked Questions

    This skill provides a structured, modular Python framework that replaces brittle scripts with a production-ready architecture, ensuring your RAG system remains maintainable when you swap vector stores or LLM providers.

    The skill is designed for Python 3.9+ environments and integrates seamlessly with FastAPI, most major vector databases, and any LLM provider that offers a standard API.

    You receive the complete modular project scaffolding, custom ingestion pipelines, retrieval logic, and an evaluation suite, along with deployment-ready FastAPI integration templates.

    Yes, the architecture specifically utilizes adapter patterns and typed interfaces, allowing you to switch between different embedding models or vector databases without rewriting your core application logic.

    While it automates the creation of the application logic and testing suites, it does not handle cloud infrastructure provisioning (like AWS/GCP setup) or the final manual tuning of evaluation thresholds.

    New in LLM Ops

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.

    Free