Skip to content

About

AI-powered RAG Q&A API for support docs — FastAPI, Claude, Voyage embeddings, Pinecone.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

support-ops

AI-powered document Q&A service. Upload documents (text or PDF), ask questions, get answers grounded in those documents with source citations.

Built with FastAPI, Anthropic Claude, Voyage AI embeddings, and Pinecone for vector search.

Features

  • Query — ask a question, get an answer retrieved from indexed documents
  • Ingest — index raw text documents
  • PDF upload — upload a PDF and index its extracted text (admin)
  • Support requests — submit a question async (simulated inbound email), poll for the generated answer
  • Namespaces — keep document sets isolated (e.g. per team/customer)

Setup

Requires Python 3.12+ and uv.

uv sync

Create a .env file in the project root:

ANTHROPIC_API_KEY=your-anthropic-key
VOYAGE_API_KEY=your-voyage-key
PINECONE_API_KEY=your-pinecone-key
PINECONE_INDEX_NAME=rag-demo

Run the server:

uv run fastapi dev main.py

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

Endpoints

Method Path Description
GET /health Service + dependency health check
POST /query Ask a question, get an answer with sources
POST /ingest Index raw text documents
POST /admin/upload-pdf Upload a PDF, extract and index its text
POST /support-request Submit a question for async RAG processing
GET /support-request/{id} Check status/answer of a support request
DELETE /namespace/{namespace} Delete all vectors in a namespace

Example: ask a question

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

Example: upload a PDF

curl -X POST http://localhost:8000/admin/upload-pdf \
  -F "file=@policy.pdf" \
  -F "namespace=default"

Example: submit a support request

curl -X POST http://localhost:8000/support-request \
  -H "Content-Type: application/json" \
  -d '{"email": "user@example.com", "question": "How do I reset my password?"}'

# then poll:
curl http://localhost:8000/support-request/{request_id}

Notes

  • Admin endpoints (/admin/upload-pdf, /namespace/{namespace} delete) have no auth yet — add before deploying publicly.
  • Support requests are stored in memory and processed via FastAPI background tasks; this simulates an event-driven email flow. Swap in a real email provider webhook (e.g. SendGrid/Postmark inbound parse) and a persistent store (DB/queue) for production use.

About

AI-powered RAG Q&A API for support docs — FastAPI, Claude, Voyage embeddings, Pinecone.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages