Autonomous Workspace Intelligence Platform
LatticeAI is an intelligent multi-agent system that analyzes your Google Workspace (Drive, Gmail, Calendar) to provide actionable insights, extract tasks, and optimize your workflow using advanced AI powered by Google's Gemini and Vertex AI.
- π€ Multi-Agent Architecture: Specialized agents for Drive analysis, email intelligence, and calendar optimization
- π Semantic Search: Vector-based search with metadata filtering for precise queries
- π§ Email Intelligence: Extract action items, deadlines, and urgent tasks from emails
- π Drive Analysis: Identify poorly named files, suggest organization improvements
- π Calendar Optimization: Analyze schedules and suggest time management improvements
- π― Date-Aware Queries: Filter results by specific dates (e.g., "emails from December 11, 2025")
- π Automatic Ingestion: Periodic workspace data synchronization
- π RESTful API: FastAPI-based backend with async support
LatticeAI/
βββ backend/
β βββ agents/ # Specialized AI agents
β β βββ orchestrator.py
β β βββ drive_analyst.py
β β βββ email_intelligence.py
β β βββ calendar_optimizer.py
β βββ core/ # Core intelligence engine
β β βββ workspace_intelligence.py
β β βββ vector_store.py
β β βββ config.py
β β βββ models.py
β βββ integrations/ # Google Workspace connectors
β β βββ workspace_connector.py
β βββ api/ # FastAPI application
β β βββ main_1.py
β βββ credentials/ # Google Cloud credentials
βββ README.md
- Python: 3.10 or higher
- Google Cloud Project with:
- Vertex AI API enabled
- Gmail API enabled
- Google Drive API enabled
- Google Calendar API enabled
- Google Cloud Credentials:
- Service Account key (for Vertex AI)
- OAuth 2.0 Client ID (for Workspace APIs)
git clone https://github.com/yourusername/Lattice-AI.git
cd Lattice-AI/latticeai/backend# Windows
python -m venv venv
venv\Scripts\activate
# macOS/Linux
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txt- Go to Google Cloud Console
- Create a Service Account with Vertex AI permissions
- Download the JSON key file
- Save it as
credentials/sa-vertex.json
- Create OAuth 2.0 Client ID in Google Cloud Console
- Download the
credentials.jsonfile - Save it as
api/credential.json
Create a .env file in the backend/ directory:
# Google Cloud Project
GCP_PROJECT_ID=your-project-id
GCP_REGION=us-central1
# Service Account Credentials
GOOGLE_CREDENTIALS_PATH=../credentials/sa-vertex.json
# Models
GEMINI_MODEL=gemini-2.0-flash
EMBEDDING_MODEL=text-embedding-004
AGENT_TEMPERATURE=0.3
AGENT_MAX_TOKENS=2000
# Vector Search
VECTOR_DIMENSIONS=768
SEMANTIC_SEARCH_TOP_K=10
SIMILARITY_THRESHOLD=0.7
# API Configuration
DEBUG=true
API_HOST=0.0.0.0
API_PORT=8000
# Data Ingestion
INGESTION_INTERVAL_SECONDS=1800
INGESTION_LOOKBACK_DAYS=7
# CORS
CORS_ORIGINS=["http://localhost:3000","http://localhost:3001"]cd api
uvicorn main_1:app --reloadThe API will be available at http://localhost:8000
Once the server is running, visit:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
POST http://localhost:8000/query
Content-Type: application/json
{
"query": "Show me emails from December 11, 2025",
"user_id": "user123"
}GET http://localhost:8000/workspace/summaryPOST http://localhost:8000/ingest| Variable | Description | Default |
|---|---|---|
GCP_PROJECT_ID |
Google Cloud Project ID | hackathon-481812 |
GCP_REGION |
Google Cloud Region | us-central1 |
GEMINI_MODEL |
Gemini model name | gemini-2.0-flash |
EMBEDDING_MODEL |
Text embedding model | text-embedding-004 |
VECTOR_DIMENSIONS |
Embedding vector size | 768 |
SEMANTIC_SEARCH_TOP_K |
Number of search results | 10 |
SIMILARITY_THRESHOLD |
Minimum similarity score | 0.7 |
INGESTION_INTERVAL_SECONDS |
Auto-ingestion interval | 1800 (30 min) |
- FastAPI
0.109.0- Modern web framework - Uvicorn
0.27.0- ASGI server - Pydantic
2.5.3- Data validation
- google-cloud-aiplatform
1.40.0- Vertex AI SDK - vertexai
1.43.0- Vertex AI generative models - google-api-python-client
2.115.0- Workspace APIs
- numpy
1.26.4- Numerical computing - scikit-learn
1.4.0- Machine learning utilities
- pytest
7.4.4- Testing framework - black
24.1.1- Code formatter - flake8
7.0.0- Linter
# Run all tests
pytest
# Run with coverage
pytest --cov=. --cov-report=html
# Run specific test file
pytest tests/test_agents.pyblack .flake8 .agents/- AI agent implementationscore/- Core intelligence and vector storeintegrations/- External API connectorsapi/- FastAPI routes and endpointstests/- Unit and integration tests
- Never commit
.envfiles or credential files - Store credentials in
credentials/directory (gitignored) - Use service accounts with minimal required permissions
- Rotate API keys regularly
- Enable 2FA on Google Cloud account
If you see 429 Quota exceeded errors:
- The system automatically switches to mock mode
- Request quota increase: Vertex AI Quotas
- Use a different GCP project with available quota
# Verify credentials path
echo $GOOGLE_CREDENTIALS_PATH
# Test service account
gcloud auth activate-service-account --key-file=credentials/sa-vertex.json# Reinstall dependencies
pip install -r requirements.txt --force-reinstall- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Your Name - Initial work
- Google Cloud Platform for Vertex AI
- FastAPI community
- OpenAI for inspiration
For issues and questions:
- π§ Email: support@latticeai.com
- π Issues: GitHub Issues
- π¬ Discussions: GitHub Discussions
Built with β€οΈ using Google Gemini and Vertex AI