🚀 Gemini API as Alternative AI Provider
This release introduces Google Gemini API as an alternative to the Claude Agent SDK for observation extraction. This gives users flexibility in choosing their AI backend while maintaining full feature parity.
✨ New Features
Gemini Provider Integration
- New
GeminiAgent: Complete implementation using Gemini's REST API for observation and summary extraction - Provider selection: Choose between Claude or Gemini directly in the Settings UI
- API key management: Configure via UI or
GEMINI_API_KEYenvironment variable - Multi-turn conversations: Full conversation history tracking for context-aware extraction
Supported Gemini Models
gemini-2.5-flash-preview-05-20(default)gemini-2.5-pro-preview-05-06gemini-2.0-flashgemini-2.0-flash-lite
Rate Limiting
- Built-in rate limiting for Gemini free tier (15 RPM) and paid tier (1000 RPM)
- Configurable via
gemini_has_billingsetting in the UI
Resilience Features
- Graceful fallback: Automatically falls back to Claude SDK if Gemini is selected but no API key is configured
- Hot-swap providers: Switch between Claude and Gemini without restarting the worker
- Empty response handling: Messages properly marked as processed even when Gemini returns empty responses (prevents stuck queue states)
- Timestamp preservation: Recovered backlog messages retain their original timestamps
🎨 UI Improvements
- Spinning favicon: Visual indicator during observation processing
- Provider status: Clear indication of which AI provider is active
📚 Documentation
- New Gemini Provider documentation with setup guide and troubleshooting
⚙️ New Settings
| Setting | Values | Description |
|---|---|---|
CLAUDE_MEM_PROVIDER
| claude | gemini
| AI provider for observation extraction |
CLAUDE_MEM_GEMINI_API_KEY
| string | Gemini API key |
CLAUDE_MEM_GEMINI_MODEL
| see above | Gemini model to use |
gemini_has_billing
| boolean | Enable higher rate limits for paid accounts |
🙏 Contributor Shout-out
Huge thanks to Alexander Knigge (@AlexanderKnigge) for contributing the Gemini provider implementation! This feature significantly expands claude-mem's flexibility and gives users more choice in their AI backend.
Full Changelog: v8.1.0...v8.2.0