Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Build a Q&A Bot over Your Company Docs with Pinecone + Claude

说明与用途

构建一个命令行问答机器人,使用 Pinecone 存储文档嵌入,检索相关片段,并用 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