A lightweight Retrieval-Augmented Generation (RAG) system built using Python, FastAPI (planned), FAISS, and Azure OpenAI. The system enables intelligent querying over structured SQL data by converting it into semantic embeddings and retrieving relevant context before generating accurate AI responses.
User Query
↓
Embedding (Azure OpenAI)
↓
FAISS Vector Search (Similarity)
↓
Top-K Relevant Documents (Context)
↓
LLM (Azure OpenAI Chat Model)
↓
Final AI Answer
- Data Loader: Reads structured SQL data and converts it into natural language documents.
- Embedding Layer: Uses Azure OpenAI to convert text into vector embeddings.
- Vector Store (FAISS): Stores embeddings and performs similarity search.
- Retriever: Finds top relevant documents based on semantic similarity.
- LLM Layer: Generates final answers using retrieved context.
git clone <repo-url> cd talentrag-ai
python -m venv .venv .venv\Scripts\activate
pip install -r requirements.txt
python -m app.main
Find Azure developer in Delhi
Create a .env file:
AZURE_OPENAI_KEY=your_key AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/ AZURE_OPENAI_EMBEDDING_MODEL=embedding-model AZURE_OPENAI_CHAT_MODEL=chat-model
SQL Data ↓ Convert to Text Documents ↓ Generate Embeddings (Azure OpenAI) ↓ Store in FAISS Vector DB ↓ User Query → Embedding ↓ Similarity Search (Top-K Results) ↓ Context Injection into LLM ↓ Final Answer Generation
Query Embedding ↓ Compare with Stored Embeddings ↓ FAISS (L2 Distance) ↓ Top-K Closest Matches Returned
- Semantic search (not keyword-based)
- Understands meaning (e.g., "Azure Dev" ≈ "Cloud Engineer")
- Uses vector similarity (distance-based matching)
- LLM is restricted to retrieved context only.
- No direct answering without data grounding.
- Improves accuracy and enterprise reliability.
Q: Find Azure developer in Delhi Context Retrieved: - Rahul (.NET Developer, Azure, Delhi) - Neha (Cloud Engineer, AWS) AI Answer: Rahul is the best match as he has Azure experience and is based in Delhi.
- Python
- FAISS (Vector Database)
- Azure OpenAI
- SQLite (Dummy Data)
- NumPy
- FastAPI (Next Phase)
