# Document RAG Pipeline Complete Pipeline Script

> Sub-skill of document-rag-pipeline: Complete Pipeline Script.

- Skill: `vamseeachanta/document-rag-pipeline-complete-pipeline-script` (Agent Skill)
- Install (CLI): `npx skillmds@latest add vamseeachanta/document-rag-pipeline-complete-pipeline-script`
- Raw SKILL.md: https://api.skillmd.com/api/skills/vamseeachanta/document-rag-pipeline-complete-pipeline-script/raw
- Safety review: PASS (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- Author: vamseeachanta (https://skillmd.com/u/vamseeachanta)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/vamseeachanta/document-rag-pipeline-complete-pipeline-script

---


# Complete Pipeline Script

## Complete Pipeline Script


```python
#!/usr/bin/env python3
"""
Document RAG Pipeline - Build searchable knowledge base from PDF folder.

Usage:
    python build_knowledge_base.py /path/to/documents --db inventory.db
    python build_knowledge_base.py /path/to/documents --search "query text"
"""

import argparse
import os
from pathlib import Path
from tqdm import tqdm

def build_inventory(folder_path, db_path):
    """Build document inventory from folder."""
    conn = create_database(db_path)
    cursor = conn.cursor()

    pdf_files = list(Path(folder_path).rglob("*.pdf"))
    print(f"Found {len(pdf_files)} PDF files")

    for pdf_path in tqdm(pdf_files, desc="Building inventory"):
        # Check if already processed

*See sub-skills for full details.*

