convez.ai
PluginDados & AnalyticsIntermediário
iamkunalkeshav

RAG Document QA

iamkunalkeshav/rag-document-qa

QA sobre documentos com citações — sem alucinações, híbrido local/cloud

Ver no GitHub
InicialPluginScore · de 0 a 100

Pipeline completo de Retrieval Augmented Generation (RAG) que permite fazer perguntas sobre documentos em texto simples, recebendo respostas citadas diretamente das fontes. Funciona 100% localmente via Ollama ou em modo cloud com OpenAI + Groq, eliminando alucinações de LLMs sobre conteúdo desconhecido.

Instalação

$npx convez-ai iamkunalkeshav/rag-document-qa

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
0
Forks
0
Acompanhando
0
Saúde
14%
Último commit
há 8 meses
Versão
—
Issues abertas
0
Contribuidores
1

Casos de uso

  • Análise e busca em bases documentais próprias
  • Sistema de perguntas e respostas para conhecimento corporativo
  • Verificação de informações contra documentos de referência

Veredito

Solução RAG pragmática e funcional com boa atenção a citações e source attribution. Arquitetura limpa e flexibilidade cloud/local são diferenciais, embora o setup local dependa de Ollama.

README

A tradução para o português deste README ainda está na fila.

rag-document-qa

I got tired of hallucinated answers from LLMs when I asked about specific documents or topics they weren't trained on. RAG (Retrieval Augmented Generation) is the fix — instead of asking the model to remember things it doesn't know, you give it the relevant context at query time and it answers from that.

This project is a full RAG pipeline. Drop in your own .txt files, ask questions in plain English, and get answers with citations so you can verify them.

How it works

  1. Your files get split into chunks
  2. Each chunk gets embedded (converted to a vector that captures its meaning)
  3. Your question also gets embedded
  4. The most similar chunks are fetched
  5. Those chunks + your question go to the LLM, which answers strictly from the context

Simple idea, but genuinely useful. The source attribution part is what I care about most — if the answer isn't in your documents, it says so.

Stack

  • Python + LangChain 1.2
  • Hybrid Support (Cloud or 100% Local)
    • Cloud Mode: OpenAI text-embedding-3-small (embeddings) + Groq llama-3.3-70b-versatile (generation)
    • Local Mode: Ollama nomic-embed-text (embeddings) + Ollama qwen2.5:1.5b (generation)
  • FAISS for the local vector store (no external DB needed)

Project structure

rag-document-qa/
├── ingestion/loader.py       # loads and chunks your documents
├── embeddings/embedder.py    # creates embeddings + builds the vector store
├── retrieval/retriever.py    # semantic search + answer generation
├── data/                     # drop your .txt files here
└── main.py

Setup

python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env

Configuration

By default, the system runs 100% Locally using Ollama to save API costs and protect privacy.

  1. Download Ollama
  2. Pull the required models: ollama pull nomic-embed-text and ollama pull qwen2.5:1.5b
  3. Ensure USE_LOCAL_MODELS=True is in your .env.

If you prefer to use Cloud Models, set USE_LOCAL_MODELS=False and provide your keys:

  • GROQ_API_KEY
  • OPENAI_API_KEY

Add your .txt or .md files to the data/ folder, then:

python main.py

There's already a sample file in data/ so you can test it right away without adding anything.

Notes

  • Groq handles answer generation (free)
  • OpenAI handles embeddings — this is the only paid part, and it's tiny (fractions of a cent per document)
  • FAISS stores everything in memory, no external services needed
  • Chunking uses overlap so context doesn't get cut off at boundaries
Ver o original no GitHub

Bom para

Relacionados