This guide will help you get the Multilingual Agentic Retrieval System up and running on your local machine.
Ensure you have the following installed:
- Node.js 20+ and npm
- Python 3.11+
- Docker Desktop (for containerized development)
- Git
- Azure CLI (for Azure deployment)
# Clone the repository
git clone <your-repo-url>
cd az-ai-agentic-retrieval
# Copy environment variables
cp .env.example .env
# Edit .env with your Azure credentials
# Required: Azure OpenAI, Storage, Cosmos DB credentials# Start all services with Docker Compose
docker-compose up -d
# Check service status
docker-compose ps
# View logs
docker-compose logs -fServices will be available at:
- Frontend: http://localhost:3001
- API: http://localhost:3000
- Processing Service: http://localhost:8000
- PostgreSQL: localhost:5432
- Redis: localhost:6379
cd backend/api
# Install dependencies
npm install
# Create logs directory
mkdir -p logs
# Start development server
npm run dev
# API will be available at http://localhost:3000cd backend/processing
# Create virtual environment
python -m venv venv
# Activate virtual environment
# Windows:
venv\Scripts\activate
# Linux/Mac:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Start development server
uvicorn src.main:app --reload --host 0.0.0.0 --port 8000
# Service will be available at http://localhost:8000cd frontend
# Install dependencies
npm install
# Start development server
npm start
# Frontend will be available at http://localhost:3001The PostgreSQL database will be automatically initialized with the init-db.sql script when using Docker Compose.
For manual setup:
# Connect to PostgreSQL
psql -h localhost -U postgres -d vector db
# Run initialization script
\i backend/processing/scripts/init-db.sqlUpdate your .env file with actual values:
# Azure OpenAI (Required)
AZURE_OPENAI_ENDPOINT=https://your-instance.openai.azure.com/
AZURE_OPENAI_API_KEY=your-api-key
AZURE_OPENAI_DEPLOYMENT_NAME=gpt-4
AZURE_OPENAI_EMBEDDING_DEPLOYMENT=text-embedding-ada-002
# Azure Storage (Required)
AZURE_STORAGE_CONNECTION_STRING=your-connection-string
# Azure Cosmos DB (Required)
COSMOS_DB_ENDPOINT=https://your-cosmos.documents.azure.com:443/
COSMOS_DB_KEY=your-key
# Azure AI Search (Required)
AZURE_SEARCH_ENDPOINT=https://your-search.search.windows.net
AZURE_SEARCH_API_KEY=your-api-key# Check API health
curl http://localhost:3000/health
# Check Processing Service health
curl http://localhost:8000/health# Upload a test document
curl -X POST http://localhost:3000/api/v1/documents/upload \
-F "file=@/path/to/test.pdf" \
-F "title=Test Document"# Submit a test query
curl -X POST http://localhost:3000/api/v1/query \
-H "Content-Type: application/json" \
-d '{"query": "What is this about?", "language": "en"}'# Backend API tests
cd backend/api
npm test
# Python tests
cd backend/processing
pytest
# Frontend tests
cd frontend
npm test# Backend API
cd backend/api
npm run lint:fix
# Python
cd backend/processing
black src/
# Frontend
cd frontend
npm run lint:fix# Build API
cd backend/api
npm run build
# Build Frontend
cd frontend
npm run build
# Build Docker images
docker-compose buildIf ports 3000, 3001, or 8000 are already in use:
# Find and kill process using the port (Windows)
netstat -ano | findstr :3000
taskkill /PID <PID> /F
# Linux/Mac
lsof -ti:3000 | xargs kill -9# Restart PostgreSQL container
docker-compose restart postgres
# Check PostgreSQL logs
docker-compose logs postgresVerify your Azure credentials and ensure:
- Services are properly provisioned
- Firewall rules allow your IP
- API keys are valid and not expired
- Upload Documents: Use the Document Manager to upload test documents
- Test Chat: Try asking questions in the Chat Interface
- Monitor Analytics: Check the Analytics dashboard for insights
- Deploy to Azure: Follow the DEPLOYMENT_OPERATIONS_GUIDE.md
# Stop all services
docker-compose down
# Rebuild and restart
docker-compose up --build -d
# View service logs
docker-compose logs -f [service-name]
# Clean up volumes
docker-compose down -v
# Execute command in running container
docker-compose exec api sh
docker-compose exec processing bash- Documentation: Check the
/docsfolder - Issues: Create an issue on GitHub
- API Docs: http://localhost:3000/api-docs (when running)
az-ai-agentic-retrieval/
├── backend/
│ ├── api/ # Node.js Express API
│ ├── processing/ # Python FastAPI service
│ └── functions/ # Azure Functions
├── frontend/ # React application
├── infrastructure/ # IaC templates
├── docs/ # Documentation
└── docker-compose.yml # Local development setup
- Use Docker Compose for consistent development environment
- Enable Hot Reload for faster development
- Check Logs regularly for errors
- Test APIs with tools like Postman or curl
- Monitor Resources with Docker Desktop
For production deployment to Azure, refer to:
For questions or issues:
- Email: support@example.com
- Documentation: https://docs.example.com
- GitHub Issues: https://github.com/your-org/project/issues