Skip to content

54Startups/aqoon-rag-fastapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aqoon RAG Starter (FastAPI)

A minimal RAG API that searches your aqoon knowledge base and uses Claude to answer questions.

Prerequisites

Setup

git clone https://github.com/54Startups/aqoon-rag-fastapi.git
cd aqoon-rag-fastapi
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
# Edit .env with your API keys

Run

uvicorn app:app --reload

Interactive API docs available at http://localhost:8000/docs.

Test

curl -X POST http://localhost:8000/ask \
  -H "Content-Type: application/json" \
  -d '{"question": "What is our leave policy?"}'

Response:

{
  "answer": "Based on your documents, the leave policy states...",
  "sources": [
    {"title": "HR Policy 2024", "document_id": "abc-123", "score": 0.92}
  ]
}

Filter by collection

curl -X POST http://localhost:8000/ask \
  -H "Content-Type: application/json" \
  -d '{"question": "What is our leave policy?", "collection": "hr-docs"}'

Troubleshooting

Symptom Cause Fix
500 Internal Server Error Invalid or underfunded Anthropic API key Check key at console.anthropic.com
.env key ignored Shell env var overrides .env Run unset ANTHROPIC_API_KEY before uvicorn
Could not import module "app" Wrong directory Make sure you're in the aqoon-rag-fastapi/ directory

Next steps

  • Add streaming responses for real-time answers
  • Add a simple HTML frontend
  • Add conversation history for follow-up questions
  • Deploy to Heroku, Railway, or Fly.io

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages