What I Learned Building an Internal Document Chatbot with RAG

Our company had too many internal policy documents, so I built a simple RAG chatbot. I used GPT-4o mini as the model, Chroma as the vector DB, and text-embedding-3-small for embeddings. At first I thought it was just "put documents in, ask questions, done," but there were many more things to tweak than I expected.

The most important part was the chunking strategy. Answers were accurate only when I split by clause; when chunks were too large, it mixed in irrelevant content and answered incorrectly.

  • Document preprocessing: Many parts broke while converting PDF tables to text, so manual correction was needed.
  • Reranking search results: Rather than putting the top 5 in as-is, I reranked them by also assigning keyword-matching scores.
  • Showing sources in answers: Adding "document name + page" greatly increased user trust.

The disappointing part is evaluation automation. I created about 30 answer keys, but as question types diversify, they need continuous maintenance, which is more labor-intensive than expected. Still, it was quite useful for teams with many repetitive queries.

by 호기심천국567

5 answers