Build a Q&A Bot over Your Company Docs with Pinecone + Claude
Описание и применение
Создайте командную строку Q&A‑бота, который обрабатывает внутренние документы компании, используя Pinecone для векторного хранения и Anthropic Claude для генерации ответов с цитатами.
Задача
New hires cannot quickly find internal policies and current rules, and keyword‑based wiki search often fails.
Результат
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.
Рабочий процесс
- 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
Доказательства
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).
- Дата записи: 2026-11-04T02:28:49.253Z