AI-powered RAG backend for A Guide Beyond Space, an interactive museum experience combining voice input, retrieval-augmented generation, and spoken answers for artwork-related questions.
beyond-space-rag-api is a FastAPI backend that powers the conversational AI layer of A Guide Beyond Space. It processes spoken visitor questions, retrieves relevant context from a curated knowledge base of artists and artworks, generates grounded answers, and returns both text and audio output.
The system is designed for museum-style interactions, where answers should remain concise, context-based, and suitable for spoken playback.
- speech-to-text via ElevenLabs
- retrieval-augmented generation over curated museum content
- answer generation via OpenAI
- text-to-speech via ElevenLabs
- FastAPI-based
/askendpoint for Unity integration
- Python 3.11
- FastAPI
- Uvicorn
- ChromaDB
- sentence-transformers
- OpenAI API
- ElevenLabs API
- Fly.io for deployment
- Docker
Returns service health and collection size. Example response: { "status": "ok", "collection_count": 425 }
Accepts an audio file and returns:
- transcript
- answer_text
- audio_base64
OPENAI_API_KEYELEVENLABS_API_KEYELEVENLABS_VOICE_IDOPENAI_MODEL=gpt-5.4-miniELEVENLABS_MODEL_ID=eleven_flash_v2_5ELEVENLABS_STT_MODEL_ID=scribe_v2ELEVENLABS_STT_LANGUAGE_CODE=deuCHROMA_PATH=data/chromaDOCS_PATH=data/docs
pip install -r requirements.txt
python scripts/build_index.py
uvicorn app.main:app --host 0.0.0.0 --port 8000This project is deployed on Fly.io with Docker.
fly deploy
Set secrets
fly secrets set OPENAI_API_KEY=your_openai_key
fly secrets set ELEVENLABS_API_KEY=your_elevenlabs_key
Check secrets
fly secrets listfly logshttps://beyond-space-rag-api.fly.dev/health
The application is containerized with Docker and runs with Uvicorn on port 10000.
The embedding model is cached during the Docker build to reduce cold-start overhead at runtime. The knowledge base is based on curated markdown files covering artworks, artists, and exhibition context. The API is designed for integration into a Unity-based application, including Windows development builds.
This repository contains the production backend used for the conversational museum guide prototype.
MIT License