Local Testing Guide
This guide walks you through testing the complete Engram platform locally with all services connected.
Prerequisites
- Docker & Docker Compose - For running local services
- Azure AI Services (Foundry) key - For agent functionality
Azure Speech Services- Voice features removed in this build- Node.js 20+ - For frontend development
- Python 3.11+ - For backend development
Step 1: Configure Environment
- Copy the example environment file:
cp .env.example .env - Edit
.envand add your Azure credentials:# Required for agent functionality (Azure AI Foundry) AZURE_AI_ENDPOINT=https://your-endpoint.services.ai.azure.com AZURE_AI_KEY=your-key-here AZURE_AI_DEPLOYMENT=gpt-4o-mini
Step 2: Start Local Services
Start all backend services with Docker Compose:
docker-compose up -d postgres zep temporal temporal-ui unstructured
Wait for services to be healthy (check with docker-compose ps).
Step 3: Start Backend API
In a separate terminal:
cd backend
pip install -r requirements.txt
uvicorn backend.api.main:app --host 0.0.0.0 --port 8082 --reload
The API will be available at: http://localhost:8082
Step 4: Start Temporal Worker
In another terminal:
cd backend
python -m backend.workflows.worker
The worker will connect to Temporal and start processing workflows.
Step 5: Start Frontend
In another terminal:
cd frontend
npm install
npm run dev
The frontend will be available at: http://localhost:5173
Step 6: Verify Services
Check API Health
curl http://localhost:8082/health
Expected response:
{
"status": "healthy",
"timestamp": "2024-...",
"version": "0.1.0"
}
Check Zep
curl http://localhost:8000/healthz
Check Temporal UI
Open browser: http://localhost:8080
Check Backend Logs
# API logs
docker-compose logs -f api
# Worker logs
docker-compose logs -f worker
Step 7: Test Chat Functionality
- Open
http://localhost:5173in your browser - Select an agent (Elena or Marcus)
- Type a message in the chat
- Verify:
- Message appears in chat
- Agent responds (if Azure AI key is configured)
- Metrics update in the right panel
- No errors in browser console
Troubleshooting
Backend API won’t start
Error: ModuleNotFoundError: No module named 'backend'
Solution: Ensure you’re in the backend/ directory or set PYTHONPATH:
export PYTHONPATH="${PWD}/backend:${PYTHONPATH}"
Frontend can’t connect to API
Error: Failed to fetch or CORS errors
Solution:
- Verify API is running on port 8082
- Check
VITE_API_URLin frontend.env(should behttp://localhost:8082) - Verify CORS is enabled in backend (check
backend/core/config.py)
Temporal connection errors
Error: Connection refused to Temporal
Solution:
- Verify Temporal is running:
docker-compose ps temporal - Check
TEMPORAL_HOSTenvironment variable - Ensure Temporal is healthy:
docker-compose logs temporal
Zep connection errors
Error: Failed to connect to Zep
Solution:
- Verify Zep is running:
docker-compose ps zep - Check Zep logs:
docker-compose logs zep - Verify PostgreSQL connection:
docker-compose logs postgres
Azure AI errors
Error: 401 Unauthorized or Invalid API key
Solution:
- Verify
AZURE_AI_KEYin.envis correct - Check
AZURE_AI_ENDPOINTformat (should behttps://your-endpoint.services.ai.azure.com) - Ensure deployment name matches:
AZURE_AI_DEPLOYMENT=gpt-4o-mini
Testing Checklist
- All Docker services are running and healthy
- Backend API responds to
/healthendpoint - Frontend loads without errors
- Chat messages send successfully
- Agent responses are received (if Azure AI credentials configured)
- Metrics update in Visual Panel
- Temporal UI is accessible
- Zep health check passes
- No errors in browser console
- No errors in backend logs
Next Steps
Once local testing passes:
- Deploy to Azure - Follow the deployment guide
- Configure GitHub Secrets - See
docs/github-secrets.md - Run CI/CD Pipeline - Push to main branch
- Monitor Production - Check Application Insights
Development Tips
Hot Reload
- Backend: Uses
--reloadflag, changes auto-restart - Frontend: Vite HMR, changes auto-refresh
- Docker Services: Restart with
docker-compose restart <service>
Debugging
- Backend: Add
import pdb; pdb.set_trace()for breakpoints - Frontend: Use browser DevTools
- Temporal: Check Temporal UI for workflow status
- Zep: Check Zep logs for memory operations
Database Access
Connect to PostgreSQL:
docker-compose exec postgres psql -U postgres -d engram
View Logs
# All services
docker-compose logs -f
# Specific service
docker-compose logs -f api
docker-compose logs -f worker
docker-compose logs -f zep
docker-compose logs -f temporal