PDF Chat RAG
ai-prasanth/sample-claude-rag-system
Chat com PDFs usando RAG e Claude API
Ver no GitHubSistema de Q&A para PDFs usando Retrieval-Augmented Generation (RAG) com Claude, Qdrant e sentence-transformers. Carregue documentos PDF na pasta data/, execute o script e faça perguntas — Claude responde usando apenas conteúdo dos seus documentos.
Instalação
npx convez-ai ai-prasanth/sample-claude-rag-system1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
Casos de uso
- Extrair informações de documentos sem edição manual
- Criar assistentes baseados em bases de conhecimento em PDF
- Análise e busca semântica em múltiplos documentos
Veredito

Implementação limpa e bem documentada de RAG com Python. Ideal para quem quer construir aplicações que extraem conhecimento de PDFs, mas requer familiaridade com APIs e embeddings vetoriais.
README
A tradução para o português deste README ainda está na fila.
PDF Chat RAG
A Retrieval-Augmented Generation (RAG) application that lets you chat with PDF documents using Claude AI. Drop PDFs into the data/ folder, run the script, and ask questions — Claude answers using only the content from your documents.
How It Works
PDF files → extract text → chunk → embed → Qdrant (vector store)
Question → embed → similarity search → top 3 chunks → Claude → Answer
Prerequisites
- Python 3.12+ — the project uses modern Python features and libraries
- Anthropic API key — get one free at console.anthropic.com
Setup
1. Clone the repository
git clone <your-repo-url>
cd pdf-chat-rag
2. Install dependencies
pip install -r requirements.txt
3. Configure your API key
cp .env.example .env
Open .env and replace your_api_key_here with your actual Anthropic API key:
ANTHROPIC_API_KEY=sk-ant-...
4. Add PDFs to the data/ folder
cp /path/to/your/document.pdf data/
You can add as many PDFs as you like — all of them will be indexed automatically.
5. Run the application
python main.py
Project Structure
pdf-chat-rag/
├── main.py # RAG pipeline (load, chunk, embed, search, answer)
├── create_sample_pdf.py # Generates a sample PDF for testing
├── requirements.txt # Python dependencies
├── .env # Your API key (not committed to git)
├── .env.example # Template for .env
├── data/ # Place your PDF files here
└── README.md
Troubleshooting
ANTHROPIC_API_KEY not set or invalid
- Make sure you copied
.env.exampleto.env(not.env.exampleitself) - Verify the key starts with
sk-ant-and has no extra spaces - Get a valid key at console.anthropic.com
No PDF files found in data/ folder
- Ensure your files have a
.pdfextension (lowercase) - Check you placed them inside the
data/folder, not the project root
Embedding model download is slow on first run
all-MiniLM-L6-v2(~90 MB) is downloaded from Hugging Face on first use- Subsequent runs use the cached model and start instantly
chromadb import error
- This project uses
qdrant-clientinstead of ChromaDB (ChromaDB is not compatible with Python 3.14+) - Run
pip install -r requirements.txtto ensure the correct packages are installed
Answers seem incorrect or vague
- The model answers only from your indexed documents — it will say "I don't know" if the answer isn't in any PDF
- Try adding more relevant PDFs to the
data/folder - Chunk size (default 500 chars) can be tuned in
chunk_text()if context is being cut off
Getting an Anthropic API Key
- Go to console.anthropic.com
- Sign up or log in
- Navigate to API Keys in the sidebar
- Click Create Key, give it a name, and copy it
- Paste it into your
.envfile asANTHROPIC_API_KEY=sk-ant-...