cj-dev-code/semantic_search
0
1# ๐ง System Architecture: Semantic Searcher2 3## ๐ Data Flow Overview41. User types a natural-language query in the Gradio UI52. Gradio sends the query to a FastAPI backend via HTTP63. Backend uses Voyage AI to generate a vector embedding74. Embedding is sent to Azure AI Search (AAIS) for semantic retrieval85. Top-k quotes and metadata are returned to the backend96. Backend sends results to Gradio, which displays them10 11## ๐งฉ Component Breakdown12 13### Frontend14- **Tool**: Gradio (Python-based UI framework)15- **Responsibility**: Capture user queries, display quote results16 17### Backend18- **Tool**: FastAPI (Python async web server)19- **Responsibility**:20 - Accept query requests21 - Fetch embeddings via Voyage AI22 - Call Azure AI Search23 - Return ranked quote matches24 25### Vector Search26- **Service**: Azure AI Search27- **Index Type**: Vector + metadata28- **Function**: Store quote embeddings and return nearest neighbors29 30### Embeddings31- **Service**: Voyage AI (`voyage-3.5` model)32- **Why**: Tuned for conceptual, emotional, and intent-rich queries33 34## ๐ณ Deployment Overview35 36| Component | Hosting Target | Notes |37|----------|------------------------|----------------------------|38| Gradio UI | Hugging Face Spaces | Lightweight, easy deploy |39| Backend | Render or HF Spaces | Dockerized FastAPI |40| Vector DB | Azure AI Search | Managed, scalable |41 42## ๐ Environment Variables (Handled via `.env`)43- `VOYAGE_API_KEY`44- `AAIS_ENDPOINT`45- `AAIS_KEY`46- `RUNDOCKERTEST` (optional, for container testing mode)