Skip to content

Repository files navigation

RAGify Docs

RAGify Docs is a Retrieval-Augmented Generation prototype for loading local documents, building a FAISS vector index, and answering questions from retrieved context. The latest version also includes a frontend folder and a static GitHub Pages landing site in docs/.

Current Capabilities

  • Loads PDFs, text files, CSVs, spreadsheets, Word documents, JSON, and markdown-ready document formats from the data/ directory.
  • Chunks documents with LangChain's RecursiveCharacterTextSplitter.
  • Embeds chunks with sentence-transformers/all-MiniLM-L6-v2.
  • Persists and queries a local FAISS index.
  • Uses Groq chat models for answer generation.
  • Provides a FastAPI entrypoint in api.py.
  • Includes a React frontend in frontend/.
  • Includes a static GitHub Pages site in docs/.

Quickstart

Create a local .env file in the project root:

GROQ_API_KEY=your_groq_api_key_here

Run the CLI query path:

uv sync
uv run python app.py "What are hallucinations in LLMs?" --top-k 5

Rebuild the vector store before querying:

uv run python app.py "What is machine learning?" --rebuild

Run the API:

uv run uvicorn api:app --reload

Preview the static site locally:

python3 -m http.server 8765 --directory docs

Then open http://127.0.0.1:8765.

Project Layout

backend/
  data_loader.py    # Document ingestion
  embedding.py      # Chunking and embeddings
  vectorstore.py    # FAISS persistence and search
  search.py         # Retrieval plus LLM answering
frontend/           # React app
docs/               # Static GitHub Pages site
data/               # Local sample documents
api.py              # FastAPI endpoints
app.py              # CLI query runner

Recommended Improvements

  • Normalize embeddings and use cosine similarity or inner-product FAISS search instead of raw L2 distance.
  • Preserve source metadata during indexing, including file path, page number, and chunk id.
  • Return citations with each generated answer so users can inspect the original evidence.
  • Add an evaluation set with expected supporting documents and track recall@k, faithfulness, latency, and hallucination rate.
  • Add hybrid retrieval with BM25 plus dense search, then rerank with a cross-encoder.
  • Add tests for loaders, chunking, FAISS save/load, empty-index handling, API routes, and prompt construction.
  • Keep generated artifacts out of git: .env, .DS_Store, __pycache__/, faiss_store/, and data/vector_store/.

GitHub Pages

The workflow in .github/workflows/pages.yml publishes the static site from docs/ whenever changes land on main. In the GitHub repository settings, set Pages to use GitHub Actions as its source.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages