Chat with your documents using AI. Upload PDFs, Word docs, or text files and ask questions about them.
You have documents. You want to ask questions about them. This app lets you do that.
You: "What does the contract say about payment terms?"
App: "According to section 4.2, payment is due within 30 days..."
It runs on your computer. Your files stay private.
First, you need Node.js installed. Download it from https://nodejs.org (pick the LTS version).
Then open your terminal:
- Windows: Press
Win + R, typecmd, press Enter - Mac: Press
Cmd + Space, typeTerminal, press Enter - Linux/WSL: Open your terminal app
Run these commands:
npx degit creativeprofit22/Claude-RAG my-rag-app
cd my-rag-app
npm installYou need a free Google AI key to make it work.
- Go to https://aistudio.google.com/apikey
- Click "Create API Key"
- Copy the key (starts with
AIza...)
Free tier: 1,000 requests/day (resets at midnight). That's plenty for personal use!
You can add it two ways:
Option A: In the app (easiest)
- Just run the app (Step 3)
- Click the Settings gear icon
- Paste your key there
Option B: In a file
- Create a file called
.envin your project folder:
GOOGLE_AI_API_KEY=paste-your-key-herenpm run devOpen your browser to http://localhost:3000
That's it! Upload documents and start chatting.
This app works with both npm (default) and Bun (alternative). Use whichever you prefer.
# Install dependencies
npm install
# Run the app
npm run dev
# Build for production
npm run buildBun is a faster JavaScript runtime. If you have it installed:
# Install dependencies
bun install
# Run the app
bun run dev
# Build for production
bun run buildNote: Both runtimes use the same
package.jsonscripts. The app behavior is identical regardless of which you choose.
Put these in your .env file if needed:
# Your API key (required)
GOOGLE_AI_API_KEY=AIza...
# Change the port (optional, default is 3000)
# Pick any number you want: 3000, 4000, 8080, 9000, etc.
PORT=3000If port 3000 is busy, pick any other number you like:
# Examples - use whichever port you want
PORT=4000 npm run dev
PORT=8080 npm run dev
PORT=9000 npm run devThen open http://localhost:YOUR_NUMBER in your browser.
- MD files
- PDF files
- Word documents (.docx)
- Text files (.txt)
- Excel spreadsheets (.xlsx, .csv)
- You upload a document
- The app breaks it into small pieces
- When you ask a question, it finds the relevant pieces
- AI reads those pieces and answers your question
By default, the app uses Gemini to answer questions. But if you have a Claude Pro subscription, you can use Claude instead for higher quality responses.
- Install it:
npm install -g @anthropic-ai/claude-code- Log in (opens browser):
claude loginThat's it! The app will automatically detect Claude and use it for responses.
Note: Claude Code CLI requires a Claude Pro, Max, Team, or Enterprise subscription. If you don't have one, Gemini works great too!
"npm not found" or "node not found" → Install Node.js first: https://nodejs.org (download the LTS version) → After installing, close and reopen your terminal
"Port 3000 already in use"
→ Something else is using that port. Pick a different number:
→ PORT=4000 npm run dev (or any number you like)
"Invalid API key"
→ Make sure you copied the full key starting with AIza
→ Check there are no extra spaces before or after the key
App won't start
→ Make sure you created the .env file in the project folder
→ Make sure it has GOOGLE_AI_API_KEY=your-key-here
"Permission denied" (Linux/Mac)
→ Try: sudo npm install
Click to expand technical details
Query → Gemini Embeddings → LanceDB → Relevant Chunks → Claude/Gemini → Response
- Embeddings: Google Gemini
- Vector DB: LanceDB (local)
- Responses: Claude Code CLI (your subscription) or Gemini (fallback)
- Server: Bun
- UI: React
GOOGLE_AI_API_KEY=xxx # Required - for embeddings
PORT=3000 # Optional - server port
RAG_DB_PATH=./data/vectors # Optional - database location
GEMINI_EMBEDDING_DIM=1024 # Optional - embedding dimensionsimport { RAGChat } from 'claude-rag/react';
import 'claude-rag/react/styles.css';
<RAGChat endpoint="/api/rag/query" />| Endpoint | Method | Description |
|---|---|---|
/api/rag/query |
POST | Ask a question |
/api/rag/upload |
POST | Upload a document |
/api/rag/documents |
GET | List all documents |
/api/rag/documents/:id |
DELETE | Delete a document |
/api/responders |
GET | Check available AI responders |
import { query, addDocument } from 'claude-rag';
await addDocument("Your text here", { name: "doc.txt" });
const result = await query("What is this about?");
console.log(result.answer);MIT - do whatever you want with it.