Build a Q&A Bot over Your Company Docs with Pinecone + Claude
Description and use
Build a command‑line Q&A bot that ingests company documents, stores embeddings in Pinecone, retrieves relevant chunks, and generates cited answers with Claude.
Problem
New hires cannot quickly find internal policies and current rules, and keyword‑based wiki search often fails.
Outcome
The script demonstrates a full RAG pipeline: chunking, embedding, retrieval, optional reranking, and Claude‑powered answer generation, with cost estimates and pitfalls for Pinecone Starter plan users.
Workflow
- Chunk markdown/plain‑text files into 500‑char pieces with 80‑char overlap
- Embed chunks via Pinecone’s hosted embedding on write
- Create a serverless Pinecone index and upsert chunks
- Search index with query embedding (recall 12)
- Optionally rerank top 12 results with bge‑reranker‑v2‑m3 keeping 4
- Build prompt including top chunks and query
- Send prompt to Claude via Messages API
- Return answer with citations
Evidence
Once a company has enough internal docs, the same problems show up: new hires can't find the leave policy, nobody remembers which version of the expense rules is current, and wiki search only works if you guess the exact words the author used
Retrieval-augmented generation (RAG) is the usual fix: split documents into chunks, embed them into a vector database, retrieve the most relevant chunks for each question, and have an LLM answer only from those chunks, with citations.
Embedding, storage and reranking all happen on Pinecone's side, so you don't install PyTorch or host an embedding model.
The free Starter plan is enough for everything here, but note its limits (as of November 2026, see Pricing and Rate limits).
- Record date: 2026-11-04T02:28:49.253Z