EMBEDDER
Overview
Summarizer-Embedder is a microservice that processes user activities into semantic vector representations for long-term project memory. This autonomous background service transforms activity events into a searchable knowledge base using modern AI/ML techniques.
Functionality
Core Tasks
Data Flow
Event Source (Pub/Sub)
↓
Summarizer-Embedder
↓
┌─────────────────┐
│ 1. Parse event │
└────────┬────────┘
↓
┌─────────────────┐
│ 2. LLM Summary │ ← Gemini 2.0 Flash
└────────┬────────┘
↓
┌─────────────────┐
│ 3. Embedding │ ← Gemini Embedding
└────────┬────────┘
↓
┌─────────────────┐
│ 4. Data Storage │
└─────────────────┘Technical Architecture
Technology Stack
Runtime: Node.js 18
Framework: Express.js
AI/ML: Google Cloud AI Platform
LLM: Gemini 2.0 Flash (summary generation)
Embeddings: Gemini Embedding Model
Storage:
BigQuery (data warehouse)
Cloud SQL MySQL (team metadata)
Deployment: Docker, Cloud Run
Components
Ecosystem Integration
Upstream Dependencies
Event Source – activity events via Pub/Sub messaging
Cloud SQL – user and team metadata storage
Google Cloud AI Platform – LLM and embedding services
Downstream Capabilities
Configuration
This section describes how to configure the microservice for your specific environment and requirements.
Environment Variables
# Optional
PORT=8080 # HTTP port (default: 8080)
PROJECT_ID=my-gcp-project # GCP project (auto-detected if empty)
# Required
DB_HOST=your-db-host # Cloud SQL host
DB_USER=your-service-account
DB_PASS=***
DB_NAME=your_databaseDeployment (Cloud Run)
# Build
docker build -t summarizer-embedder .
# Deploy
gcloud run deploy summarizer-embedder \
--image=gcr.io/PROJECT_ID/summarizer-embedder \
--region=us-central1 \
--set-env-vars="DB_HOST=...,DB_USER=...,DB_PASS=...,DB_NAME=..." \
--allow-unauthenticated=falsePub/Sub Subscription
gcloud pubsub subscriptions create summarizer-sub \
--topic=report-events \
--push-endpoint=https://summarizer-embedder-xxx.run.app/ \
--ack-deadline=60Error Handling
Resilience Strategy
Security
Data Protection
Authentication: Google Cloud IAM
Authorization: Service Account with minimal permissions:
bigquery.dataEditor(your_project.summaries)cloudsql.clientaiplatform.user
Network: Cloud SQL via Private IP
Secrets: Env vars in Cloud Run (not in code)
Data Security
Embedding Configuration: Vector parameters are configurable based on your use case
Model Abstraction: AI services are accessed through Google Cloud APIs with proper authentication
Data Isolation: Each deployment maintains separate data boundaries
Monitoring & Observability
Key Metrics
Throughput: Number of processed events/min
Latency: End-to-end processing time
Success rate: % of events with vector vs without
Error rate: LLM, embedding, BigQuery errors
Recommended Dashboards
Cloud Monitoring:
- Request count (Cloud Run)
- Request latency p50/p95/p99
- Error rate by type
- BigQuery insert operations
- Cloud SQL connection poolDevelopment & Roadmap
Current Limitations
No retry logic for transient errors
Single region (us-central1)
No batching for embeddings
No event deduplication
Potential Improvements
FAQ
Version: 1.0.0 Date: July 30, 2025 Maintainer: Development Team