fix(graphiti): address additional CodeRabbit review comments

- Fix FalkorDB default port from 6379 to 6380
- Update provider list comment to include Google AI
- Fix requirements.txt comment to mention both LLM and embeddings
- Add logging and warning for unimplemented tool calling in GoogleLLMClient
- Fix overly broad exception handling (catch only JSONDecodeError)
- Add Azure deployment name validation (LLM and embedding deployments)
This commit is contained in:
adryserage
2025-12-19 08:01:09 -05:00
parent 679b8cd948
commit a107ed03a3
8 changed files with 114 additions and 16 deletions
+55
View File
@@ -1,3 +1,58 @@
## 2.6.0 - Multi-Provider Graphiti Support & Platform Fixes
### ✨ New Features
- **Google AI Provider for Graphiti**: Full Google AI (Gemini) support for both LLM and embeddings in the Memory Layer
- Add GoogleLLMClient with gemini-2.0-flash default model
- Add GoogleEmbedder with text-embedding-004 default model
- UI integration for Google API key configuration with link to Google AI Studio
- **Ollama LLM Provider in UI**: Add Ollama as an LLM provider option in Graphiti onboarding wizard
- Ollama runs locally and doesn't require an API key
- Configure Base URL instead of API key for local inference
- **LLM Provider Selection UI**: Add provider selection dropdown to Graphiti setup wizard for flexible backend configuration
- **Per-Project GitHub Configuration**: UI clarity improvements for per-project GitHub org/repo settings
### 🛠️ Improvements
- Enhanced Graphiti provider factory to support Google AI alongside existing providers
- Updated env-handlers to properly populate graphitiProviderConfig from .env files
- Improved type definitions with proper Graphiti provider config properties in AppSettings
- Better API key loading when switching between providers in settings
### 🐛 Bug Fixes
- **node-pty Migration**: Replaced node-pty with @lydell/node-pty for prebuilt Windows binaries
- Updated all imports to use @lydell/node-pty directly
- Fixed "Cannot find module 'node-pty'" startup error
- **GitHub Organization Support**: Fixed repository support for GitHub organization accounts
- Add defensive array validation for GitHub issues API response
- **Asyncio Deprecation**: Fixed asyncio deprecation warning by using get_running_loop() instead of get_event_loop()
- Applied ruff formatting and fixed import sorting (I001) in Google provider files
### 🔧 Other Changes
- Added google-generativeai dependency to requirements.txt
- Updated provider validation to include Google/Groq/HuggingFace type assertions
---
## What's Changed
- fix(graphiti): address CodeRabbit review comments by @adryserage in 679b8cd
- fix(lint): sort imports in Google provider files by @adryserage in 1a38a06
- feat(graphiti): add Google AI as LLM and embedding provider by @adryserage in fe69106
- fix: GitHub organization repository support by @mojaray2k in 873cafa
- feat(ui): add LLM provider selection to Graphiti onboarding by @adryserage in 4750869
- fix(types): add missing AppSettings properties for Graphiti providers by @adryserage in 6680ed4
- feat(ui): add Ollama as LLM provider option for Graphiti by @adryserage in a3eee92
- fix(ui): address PR review feedback for Graphiti provider selection by @adryserage in b8a419a
- fix(deps): update imports to use @lydell/node-pty directly by @adryserage in 2b61ebb
- fix(deps): replace node-pty with @lydell/node-pty for prebuilt binaries by @adryserage in e1aee6a
- fix: add UI clarity for per-project GitHub configuration by @mojaray2k in c9745b6
- fix: add defensive array validation for GitHub issues API response by @mojaray2k in b3636a5
---
## 2.5.5 - Enhanced Agent Reliability & Build Workflow
### ✨ New Features
+3 -3
View File
@@ -118,7 +118,7 @@ See [RELEASE.md](RELEASE.md) for detailed release process documentation.
- **worktree.py** - Git worktree isolation for safe feature development
- **memory.py** - File-based session memory (primary, always-available storage)
- **graphiti_memory.py** - Optional graph-based cross-session memory with semantic search
- **graphiti_providers.py** - Multi-provider factory for Graphiti (OpenAI, Anthropic, Azure, Ollama)
- **graphiti_providers.py** - Multi-provider factory for Graphiti (OpenAI, Anthropic, Azure, Ollama, Google AI)
- **graphiti_config.py** - Configuration and validation for Graphiti integration
- **linear_updater.py** - Optional Linear integration for progress tracking
@@ -192,8 +192,8 @@ Dual-layer memory architecture:
- Graph database with semantic search (FalkorDB)
- Cross-session context retrieval
- Multi-provider support (V2):
- LLM: OpenAI, Anthropic, Azure OpenAI, Ollama
- Embedders: OpenAI, Voyage AI, Azure OpenAI, Ollama
- LLM: OpenAI, Anthropic, Azure OpenAI, Ollama, Google AI (Gemini)
- Embedders: OpenAI, Voyage AI, Azure OpenAI, Ollama, Google AI
Enable with: `GRAPHITI_ENABLED=true` + provider credentials. See `.env.example`.
+5 -3
View File
@@ -248,12 +248,13 @@ The Memory Layer is a **hybrid RAG system** combining graph nodes with semantic
**Architecture:**
- **Backend**: FalkorDB (graph database) via Docker
- **Library**: Graphiti for knowledge graph operations
- **Providers**: OpenAI, Anthropic, Azure OpenAI, or Ollama (local/offline)
- **Providers**: OpenAI, Anthropic, Azure OpenAI, Google AI, or Ollama (local/offline)
| Setup | LLM | Embeddings | Notes |
|-------|-----|------------|-------|
| **OpenAI** | OpenAI | OpenAI | Simplest - single API key |
| **Anthropic + Voyage** | Anthropic | Voyage AI | High quality |
| **Google AI** | Gemini | Google | Single API key, fast inference |
| **Ollama** | Ollama | Ollama | Fully offline |
| **Azure** | Azure OpenAI | Azure OpenAI | Enterprise |
@@ -309,11 +310,12 @@ The `.auto-claude/` directory is gitignored and project-specific - you'll have o
| `CLAUDE_CODE_OAUTH_TOKEN` | Yes | OAuth token from `claude setup-token` |
| `AUTO_BUILD_MODEL` | No | Model override (default: claude-opus-4-5-20251101) |
| `GRAPHITI_ENABLED` | Recommended | Set to `true` to enable Memory Layer |
| `GRAPHITI_LLM_PROVIDER` | For Memory | LLM provider: openai, anthropic, azure_openai, ollama |
| `GRAPHITI_EMBEDDER_PROVIDER` | For Memory | Embedder: openai, voyage, azure_openai, ollama |
| `GRAPHITI_LLM_PROVIDER` | For Memory | LLM provider: openai, anthropic, azure_openai, ollama, google |
| `GRAPHITI_EMBEDDER_PROVIDER` | For Memory | Embedder: openai, voyage, azure_openai, ollama, google |
| `OPENAI_API_KEY` | For OpenAI | Required for OpenAI provider |
| `ANTHROPIC_API_KEY` | For Anthropic | Required for Anthropic LLM |
| `VOYAGE_API_KEY` | For Voyage | Required for Voyage embeddings |
| `GOOGLE_API_KEY` | For Google | Required for Google AI (Gemini) provider |
See `auto-claude/.env.example` for complete configuration options.
@@ -151,7 +151,7 @@ ${existingVars['ENABLE_FANCY_UI'] !== undefined ? `ENABLE_FANCY_UI=${existingVar
# =============================================================================
# GRAPHITI MEMORY INTEGRATION (OPTIONAL)
# Multi-provider support: OpenAI, Anthropic, Azure OpenAI, Ollama, Voyage
# Multi-provider support: OpenAI, Anthropic, Google AI, Azure OpenAI, Ollama, Voyage
# =============================================================================
${existingVars['GRAPHITI_ENABLED'] ? `GRAPHITI_ENABLED=${existingVars['GRAPHITI_ENABLED']}` : '# GRAPHITI_ENABLED=false'}
@@ -106,7 +106,7 @@ export function GraphitiStep({ onNext, onBack, onSkip }: GraphitiStepProps) {
const { settings, updateSettings } = useSettingsStore();
const [config, setConfig] = useState<GraphitiConfig>({
enabled: false,
falkorDbUri: 'bolt://localhost:6379',
falkorDbUri: 'bolt://localhost:6380',
llmProvider: 'openai',
embeddingProvider: 'openai',
openaiApiKey: settings.globalOpenAIApiKey || '',
@@ -186,6 +186,12 @@ export function GraphitiStep({ onNext, onBack, onSkip }: GraphitiStepProps) {
if (llmProvider === 'azure_openai' || embeddingProvider === 'azure_openai') {
if (!config.azureOpenaiApiKey.trim()) return 'Azure OpenAI API key';
if (!config.azureOpenaiBaseUrl.trim()) return 'Azure OpenAI Base URL';
if (llmProvider === 'azure_openai' && !config.azureOpenaiLlmDeployment.trim()) {
return 'Azure OpenAI LLM deployment name';
}
if (embeddingProvider === 'azure_openai' && !config.azureOpenaiEmbeddingDeployment.trim()) {
return 'Azure OpenAI embedding deployment name';
}
}
if (embeddingProvider === 'voyage') {
if (!config.voyageApiKey.trim()) return 'Voyage API key';
+25 -2
View File
@@ -140,10 +140,10 @@
# Choose which providers to use for LLM and embeddings.
# Default is "openai" for both.
# LLM provider: openai | anthropic | azure_openai | ollama
# LLM provider: openai | anthropic | azure_openai | ollama | google
# GRAPHITI_LLM_PROVIDER=openai
# Embedder provider: openai | voyage | azure_openai | ollama
# Embedder provider: openai | voyage | azure_openai | ollama | google
# GRAPHITI_EMBEDDER_PROVIDER=openai
# =============================================================================
@@ -191,6 +191,23 @@
# Available: voyage-3 (1024 dim), voyage-3-lite (512 dim)
# VOYAGE_EMBEDDING_MODEL=voyage-3
# =============================================================================
# GRAPHITI: Google AI Provider
# =============================================================================
# Use Google AI (Gemini) for both LLM and embeddings.
# Get API key from: https://aistudio.google.com/apikey
#
# Required: GOOGLE_API_KEY
# Google AI API Key
# GOOGLE_API_KEY=AIzaSyxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Google LLM Model (default: gemini-2.0-flash)
# GOOGLE_LLM_MODEL=gemini-2.0-flash
# Google Embedding Model (default: text-embedding-004)
# GOOGLE_EMBEDDING_MODEL=text-embedding-004
# =============================================================================
# GRAPHITI: Azure OpenAI Provider
# =============================================================================
@@ -331,3 +348,9 @@
# AZURE_OPENAI_BASE_URL=https://your-resource.openai.azure.com/...
# AZURE_OPENAI_LLM_DEPLOYMENT=gpt-5
# AZURE_OPENAI_EMBEDDING_DEPLOYMENT=text-embedding-3-small
#
# --- Example 5: Google AI (Gemini) ---
# GRAPHITI_ENABLED=true
# GRAPHITI_LLM_PROVIDER=google
# GRAPHITI_EMBEDDER_PROVIDER=google
# GOOGLE_API_KEY=AIzaSyxxxxxxxx
@@ -6,10 +6,13 @@ Google Gemini LLM client implementation for Graphiti.
Uses the google-generativeai SDK.
"""
import logging
from typing import TYPE_CHECKING, Any
from ..exceptions import ProviderError, ProviderNotInstalled
logger = logging.getLogger(__name__)
if TYPE_CHECKING:
from graphiti_config import GraphitiConfig
@@ -116,8 +119,11 @@ class GoogleLLMClient:
try:
data = json.loads(response.text)
return response_model(**data)
except (json.JSONDecodeError, Exception):
# If parsing fails, return raw text
except json.JSONDecodeError:
# If JSON parsing fails, return raw text
logger.warning(
"Failed to parse JSON response from Google AI, returning raw text"
)
return response.text
else:
response = await loop.run_in_executor(
@@ -135,16 +141,22 @@ class GoogleLLMClient:
"""
Generate a response with tool calling support.
Note: Tool calling is not yet implemented for Google AI provider.
This method will log a warning and fall back to regular generation.
Args:
messages: List of message dicts
tools: List of tool definitions
**kwargs: Additional arguments
Returns:
Generated response with potential tool calls
Generated response (without tool calls)
"""
# For now, fall back to regular generation
# Tool calling can be added later if needed
if tools:
logger.warning(
"Google AI provider does not yet support tool calling. "
"Tools will be ignored and regular generation will be used."
)
return await self.generate_response(messages, **kwargs)
+1 -1
View File
@@ -5,5 +5,5 @@ python-dotenv>=1.0.0
# Memory Integration (highly recommended) but can be disabled by commenting out the line below
graphiti-core[falkordb]>=0.5.0
# Google AI embeddings (optional - for Gemini embeddings)
# Google AI (optional - for Gemini LLM and embeddings)
google-generativeai>=0.8.0