Skip to content

sanyagup/RAGSearch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RAGSearch

A minimal Retrieval-Augmented Generation search tool. Point it at a folder of .txt / .md / .pdf files and ask questions; answers are generated by an OpenAI model using only your documents as context, with inline citations.

Setup

# 1. Install dependencies (a virtualenv is recommended)
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt

# 2. Add your OpenAI API key
cp .env.example .env
# then edit .env and paste your key after OPENAI_API_KEY=

Get a key at https://platform.openai.com/api-keys

Usage

# Drop your PDFs (or .txt/.md files) into the ./data folder, then build the index.
# You can pass a folder or a single file:
python main.py ingest data
python main.py ingest data/my-report.pdf

# Ask a one-off question
python main.py ask "How does RAGSearch work?"

# Or chat interactively
python main.py chat

How it works

Step What happens
ingest Files are chunked, each chunk is embedded with text-embedding-3-small, and vectors are saved to a local index.npz / index.json.
ask Your question is embedded, compared to every chunk via cosine similarity, and the top matches are sent to gpt-4o-mini as grounding context.

Configuration

Set these in .env to override the defaults:

  • OPENAI_API_KEY — required
  • EMBEDDING_MODEL — default text-embedding-3-small
  • CHAT_MODEL — default gpt-4o-mini

Your .env and the generated index are git-ignored.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages