A robust, scalable, and secure Multi-Tenant AI Intelligence Platform designed to deliver advanced RAG (Retrieval-Augmented Generation) capabilities. Built with a modern tech stack, it ensures data isolation, efficient document processing, and intelligent chat interactions for multiple tenants.
- Multi-Tenancy Architecture: Secure data isolation and management for multiple tenants using a shared application instance.
- Advanced RAG Pipeline: High-performance retrieval system leveraging Azure AI Search for semantic understanding and accurate context retrieval.
- Intelligent Chat Interface: Interactive chat capabilities powered by LLMs, with context-aware responses based on ingested documents.
- Document Ingestion Engine: Automated pipeline for scraping, processing, and indexing various document formats.
- Robust Authentication: Secure JWT-based authentication and authorization system integrated directly into the FastAPI backend.
- Scalable Infrastructure: Designed for cloud-native deployment on Azure, utilizing Cosmos DB for metadata and Azure AI Search for vector storage.
- Comprehensive Monitoring: Integrated logging and telemetry for real-time performance tracking and debugging.
- Frontend: Streamlit - For a rapid, interactive, and data-centric user interface.
- Backend: FastAPI - High-performance, easy-to-learn framework for building APIs with Python.
- Database: Azure Cosmos DB - Globally distributed, multi-model database service.
- Vector Search: Azure AI Search - AI-powered cloud search service for mobile and web app development.
- Containerization: Docker - For consistent development and deployment environments.
- Orchestration: Azure Container Apps / Azure App Service (intended deployment targets).
├── src/
│ ├── frontend/ # Streamlit application (UI logic, components, state management)
│ ├── backend/ # FastAPI application (Routes, Middleware, Auth, Controllers)
│ ├── shared/ # Shared utilities, constants, domain models, and logging config
│ ├── database/ # Database connection logic and ODM (Cosmos DB)
│ ├── vector_search/ # Azure AI Search client wrappers and index management
│ └── ingestion/ # Document processing and ingestion pipelines
├── tests/ # Unit and integration tests (pytest)
├── deployment/ # Dockerfiles, CI/CD workflows, and IaC templates
├── docs/ # Project documentation
├── .env.example # Template for environment variables
└── requirements.txt # Python dependencies
- Python 3.9+
- Azure CLI (optional, for Azure deployment)
- Access to Azure OpenAI, Azure Cosmos DB, and Azure AI Search resources.
git clone <repository-url>
cd Multi-Tenant-AI-Intelligence-Platform# Create virtual environment
python -m venv .venv
# Activate (Windows PowerShell)
.venv\Scripts\Activate.ps1
# Activate (macOS/Linux)
source .venv/bin/activatepip install --upgrade pip
pip install -r requirements.txtCreate a .env file in the root directory by copying .env.example. Fill in the required values:
cp .env.example .envRequired Variables:
JWT_SECRET_KEY: Secret for signing JWT tokens.COSMOS_ENDPOINT,COSMOS_KEY,COSMOS_DB_NAME: Cosmos DB connection details.AZURE_SEARCH_ENDPOINT,AZURE_SEARCH_API_KEY: Azure AI Search connection details.OPENAI_API_KEY,OPENAI_API_BASE,OPENAI_API_VERSION: Azure OpenAI configuration.
Note: Never commit your
.envfile to version control.
Start the backend server:
uvicorn src.backend.main:app --reload --host 0.0.0.0 --port 8000API Documentation will be available at: http://localhost:8000/docs
In a new terminal window (with the virtual environment activated), start the frontend:
streamlit run src/frontend/app.pyThe application will open in your browser at: http://localhost:8501
Run the test suite using pytest:
pytestTo run specific tests or with verbose output:
pytest tests/ -vThe project includes Docker support and is ready for deployment to Azure.
-
Build Docker Image:
docker build -t multi-tenant-ai-platform . -
Deploy to Azure: Refer to the
deployment/directory for specific CI/CD pipelines (GitHub Actions) and Infrastructure-as-Code (IaC) templates.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a feature branch (
git checkout -b feature/AmazingFeature). - Commit your changes (
git commit -m 'Add some AmazingFeature'). - Push to the branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
[License Name] - See the LICENSE file for details.