- ✅ Docker containers running (Qdrant, context-server)
- ✅ Google API key for Gemini API
- Visit: https://makersuite.google.com/app/apikey
- Click "Create API Key"
- Copy the key (starts with
AIza...)
.\scripts\setup_google_embeddings.ps1That's it! The script will:
- Configure your API key
- Update embeddings provider to Google
- Recreate Qdrant collection (768 dimensions)
- Restart the container
- Verify everything works
# Check health
curl http://localhost:8000/health | ConvertFrom-Json
# Check logs
docker logs context-server --tail 50 | Select-String "Google"Expected output:
✅ Google embeddings initialized (dim=768)
- Restart Claude Code CLI
- Run:
/mcp - Should see: "Context: Connected ✅"
- Test search functionality
The local model download was failing with SSL errors:
SSLEOFError: EOF occurred in violation of protocol
HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded
- ✅ No downloads - No local model needed
- ✅ No SSL issues - Direct API calls
- ✅ Better quality - Google's latest embedding model
- ✅ Faster startup - No 12-second model loading
- ✅ Less memory - No 500MB model in RAM
- ✅ 768 dimensions - More detailed embeddings (vs 384)
# Before
EMBEDDINGS_PROVIDER=sentence-transformers
QDRANT_VECTOR_SIZE=384
# After
EMBEDDINGS_PROVIDER=google
GOOGLE_API_KEY=AIza...
QDRANT_VECTOR_SIZE=768Before: Container → Download Model → Load Model → Generate Embeddings
After: Container → Google API → Generate Embeddings
# Edit: deployment/docker/.env
EMBEDDINGS_PROVIDER=google
GOOGLE_API_KEY=AIza_your_key_here
GOOGLE_EMBEDDING_MODEL=text-embedding-004
QDRANT_VECTOR_SIZE=768# Delete old collection
Invoke-RestMethod -Uri "http://localhost:6333/collections/context_vectors" -Method Delete
# Create new collection (768 dimensions)
$body = @{
vectors = @{
size = 768
distance = "Cosine"
}
} | ConvertTo-Json
Invoke-RestMethod -Uri "http://localhost:6333/collections/context_vectors" -Method Put -Body $body -ContentType "application/json"docker-compose -f deployment/docker/docker-compose.yml restart context-serverFix: Make sure API key is in .env and container is restarted
Fix: Recreate Qdrant collection with 768 dimensions (run setup script)
Fix: Verify key at https://makersuite.google.com/app/apikey
Fix: Make sure EMBEDDINGS_PROVIDER=google in .env file
- Rate Limit: 1,500 requests per day
- Cost: Free for moderate use
- Upgrade: Available if needed
- Initial indexing: ~100-500 requests (one-time)
- Daily searches: ~10-50 requests
- Well within free tier for most projects
If you need to switch back:
# Edit .env
EMBEDDINGS_PROVIDER=sentence-transformers
QDRANT_VECTOR_SIZE=384
# Recreate collection (384 dimensions)
# Delete and recreate as shown above
# Restart container
docker-compose -f deployment/docker/docker-compose.yml restart context-server- Got Google API key from https://makersuite.google.com/app/apikey
- Ran
.\scripts\setup_google_embeddings.ps1 - Health endpoint shows
"provider": "google" - Logs show "✅ Google embeddings initialized"
- Restarted Claude Code CLI
-
/mcpshows "Context: Connected ✅" - Search functionality works
- Full Documentation:
GOOGLE_EMBEDDINGS_SOLUTION.md - API Reference: https://ai.google.dev/api/embeddings
- Get API Key: https://makersuite.google.com/app/apikey
Ready to start? Run: .\scripts\setup_google_embeddings.ps1