Building an AI Tutor with Enhanced LLM Accuracy Through Knowledge Base Integration
clipping · Education · 2023 · source Agentic: no · promotional bias: med · source-backed · extracted with prompt 0.5.4 (schema v2)
Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.
Problem
Domain: High-stakes educational tutoring
Clipping needed an AI tutor for Brazil's diplomatic career exam that reduced hallucinations, outdated knowledge, and language bias enough to be useful in a high-stakes learning context.
Constraints:
- Generic LLM fluency can produce plausible but wrong educational answers.
- The exam depends on current, domain-specific knowledge not reliably present in GPT-4 pretraining.
- The system needed to outperform a strong generic model on a real examination benchmark.
- Knowledge adaptation mattered more than style adaptation.
Architecture
ClippingGPT augments GPT with an external proprietary knowledge base. The system splits documents into chunks, creates embeddings with OpenAI's API, stores embeddings in Redis as a vector database, embeds the user's question, ranks relevant chunks by semantic distance, and sends those chunks as context to GPT through the Completion API.
Diagram confidence: explicit (topology described by the source).
flowchart LR student[Student] --> clippinggpt-tutor[ClippingGPT Tutor] knowledge-base[Knowledge Base] --> chunking-pipeline[Chunking Pipeline] chunking-pipeline --> embedding-pipeline[Embedding Pipeline] embedding-pipeline --> redis-vector-db[Redis Vector DB] clippinggpt-tutor --> query-embedder[Query Embedder] query-embedder --> redis-vector-db[Redis Vector DB] query-embedder --> clippinggpt-tutor[ClippingGPT Tutor] clippinggpt-tutor --> gpt-completion-api[GPT Completion API]
Components
| Component | Role | Interacts with |
|---|---|---|
Student |
Learner asking exam-preparation questions. | ClippingGPT Tutor |
ClippingGPT Tutor |
Conversational tutor using retrieved exam knowledge. | Query Embedder, GPT Completion API |
Knowledge Base |
Trusted proprietary exam-preparation corpus. | Chunking Pipeline |
Chunking Pipeline |
Splits source documents into retrievable sections. | Embedding Pipeline |
Embedding Pipeline |
Uses OpenAI embeddings for documents and queries. | Redis Vector DB, Query Embedder |
Redis Vector DB |
Stores document embeddings and supports semantic retrieval. | Query Embedder |
Query Embedder |
Embeds user questions and ranks relevant chunks. | ClippingGPT Tutor, Redis Vector DB |
GPT Completion API |
Generates final answers from enriched context. | ClippingGPT Tutor |
Data flow
Documents are chunked, embedded, and stored in Redis. When a student asks a question, the query is embedded, relevant chunks are ranked by distance, and the selected context is sent to GPT to produce an answer grounded in Clipping's knowledge base.
Why this architecture
Clipping chose embeddings/RAG because the failure was knowledge accuracy, not style. Grounding answers in a trusted external knowledge base directly targets hallucinations, outdated content, and local-domain blind spots.
Models used: GPT-4 · OpenAI Embeddings API · OpenAI Completion API
Scale
- Clipping reports a 94% average approval rate in the Brazilian Diplomatic Career Examination.“is a startup that helps candidates excel in highly competitive exams. With an average approval rate of 94% in the Brazilian Diplomatic Career Examination, we have been building with AI and conversational interfaces in education since 2018, when we won the Bot Awards Brazil as best chatbot”article, stated
- ClippingGPT outperformed GPT-4 by 26% on the exam.“* outperforming GPT-4 by 26% Press enter or click to view image in full size Clipping GPT in 23th place among the top 35 approved in diplomatic career entrance exam”article, stated
- ClippingGPT placed 23rd among the top 35 approved candidates.“Clipping GPT in 23th place among the top 35 approved in diplomatic career entrance exam As for GPT 4, it scored 473.8, finishing at 177th place not making a place among the 35 approved candidates.”article, stated
- GPT-4 scored 60% on the TruthfulQA benchmark cited by the article.“GPT-4 scored 60% of accuracy on TruthfulQA benchmark, a test across a variety of categories designed to measure the truthfulness of a large language model (LLM).”article, stated
Alternatives considered (roads not taken)
Use generic ChatGPT/GPT-4 alone.
Rejected because: Generic LLMs hallucinate and lack current specialized exam knowledge.
Fine-tune for the core knowledge problem.
Rejected because: The team viewed fine-tuning as more suited to style, while embeddings teach knowledge.
Rely on pretraining currency.
Rejected because: The exam requires up-to-date knowledge, and GPT-4 has cutoff limitations.
Patterns
rag-retrieval (education)
The tutor retrieves relevant knowledge-base chunks before generating answers.
retrieval-ranking (knowledge)
Chunks are ranked based on relevance to the query embedding.
eval-driven-development (benchmarking)
Clipping validated the approach by blind grading exam answers and comparing against GPT-4 and approved candidates.
Tradeoffs
Adaptation mechanism
Chose Embeddings and retrieval over Fine-tuning as the main technique.
Rationale: The goal was factual knowledge recall, not style imitation.
Benchmark choice
Chose Diplomatic career entrance exam over Generic education QA benchmark.
Rationale: The exam stresses local, current, high-stakes knowledge.
Gotchas (what bit them)
Fluency can be actively harmful in education.
Root cause: Students may trust plausible-sounding but wrong answers while studying.
Resolution: Ground tutoring answers in a trusted external knowledge base.
External knowledge does not eliminate every hallucination.
Root cause: Some subjects still require local, current, or highly specialized content.
Resolution: Treat RAG as mitigation and continue prompt/retrieval iteration.
Evaluation
Clipping evaluated by generating answers to official 2022 exam questions, blind-grading them with specialized teachers, repeating with ClippingGPT, and comparing against GPT-4 and approved candidates.
Metrics: Exam score · Rank among approved candidates · Performance vs GPT-4 · Subject-level gap · Hallucination reduction
Outcomes
- ClippingGPT outperformed GPT-4 by 26%.
- ClippingGPT placed 23rd among the top 35 approved candidates.
- The experiment showed external knowledge can materially improve high-stakes educational accuracy.
The source reports a 94% approval-rate business context, 26% outperformance over GPT-4, 23rd place among 35 approved candidates, and Redis-backed embedding retrieval.