A minimal RAG API that searches your aqoon knowledge base and uses Claude to answer questions.
- An aqoon account with documents uploaded
- An aqoon API key (get one at aqoon.ai/keys/)
- An Anthropic API key
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 keysuvicorn app:app --reloadInteractive API docs available at http://localhost:8000/docs.
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}
]
}curl -X POST http://localhost:8000/ask \
-H "Content-Type: application/json" \
-d '{"question": "What is our leave policy?", "collection": "hr-docs"}'| 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 |
- 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
MIT