Commit graph

32 commits

Author SHA1 Message Date
Daniel Chalef
51d23e6eaf conductor-checkpoint-msg_01884eN3wprtCkrEgEaRDzko 2025-10-30 16:48:26 -07:00
Daniel Chalef
c6321a65e7 conductor-checkpoint-msg_01UU5jQcfrW5btRJB3zy5KQZ 2025-10-30 16:46:31 -07:00
Daniel Chalef
d0f494039a Add comprehensive SEMAPHORE_LIMIT documentation
Added detailed documentation for SEMAPHORE_LIMIT configuration to help users optimize episode processing concurrency based on their LLM provider's rate limits.

Changes:

1. **graphiti_mcp_server.py**
   - Expanded inline comments from 3 lines to 26 lines
   - Added provider-specific tuning guidelines (OpenAI, Anthropic, Azure, Ollama)
   - Documented symptoms of too-high/too-low settings
   - Added monitoring recommendations

2. **README.md**
   - Expanded "Concurrency and LLM Provider 429 Rate Limit Errors" section
   - Added tier-specific recommendations for each provider
   - Explained relationship between episode concurrency and LLM request rates
   - Added troubleshooting symptoms and monitoring guidance
   - Included example .env configuration

3. **config.yaml**
   - Added header comment referencing detailed documentation
   - Noted default value and suitable use case

4. **.env.example**
   - Added SEMAPHORE_LIMIT with inline tuning guidelines
   - Quick reference for all major LLM provider tiers
   - Cross-reference to README for full details

Benefits:
- Users can now make informed decisions about concurrency settings
- Reduces likelihood of 429 rate limit errors from misconfiguration
- Helps users maximize throughput within their rate limits
- Provides clear troubleshooting guidance

Addresses PR #1024 review comment about magic number documentation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 16:35:29 -07:00
Daniel Chalef
7520c8f8d7 Fix critical PR review issues
Fixed high-impact issues from PR #1024 code review:

1. **Boolean conversion bug (schema.py)**
   - Fixed _expand_env_vars returning strings 'true'/'false' instead of booleans
   - Now properly converts boolean-like strings (true/false/1/0/yes/no/on/off) to actual booleans
   - Simplified logic by removing redundant string-to-string conversions
   - Added support for common boolean string variations

2. **Dependency management (pyproject.toml)**
   - Removed pytest from main dependencies (now only in dev dependencies)
   - Moved azure-identity to optional dependencies under new [azure] group
   - Prevents forcing Azure and testing dependencies on all users

3. **Conditional Azure imports (utils.py)**
   - Made azure-identity import conditional in create_azure_credential_token_provider()
   - Raises helpful ImportError with installation instructions if not available
   - Follows lazy-import pattern for optional dependencies

4. **Documentation fix (graphiti_mcp_server.py)**
   - Fixed confusing JSON escaping in add_memory docstring example
   - Changed from triple-backslash escaping to standard JSON string
   - Updated comment to clarify standard JSON escaping is used

Issues verified as already fixed:
- Docker build context (all docker-compose files use context: ..)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 16:25:34 -07:00
Daniel Chalef
7f6b835839 Complete Kuzu removal from MCP server
Removed all remaining Kuzu references from:
- Test fixtures (test_fixtures.py): Changed default database to falkordb, removed kuzu configuration
- Test runner (run_tests.py): Removed kuzu from database choices, checks, and markers
- Integration tests (test_comprehensive_integration.py): Removed kuzu from parameterized tests and environment setup
- Test README: Updated all examples and documentation to reflect falkordb as default
- Docker README: Completely rewrote to remove KuzuDB section, updated with FalkorDB combined image as default

All Kuzu support has been completely removed from the MCP server codebase. FalkorDB (via combined container) is now the default database backend.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 14:13:56 -07:00
Daniel Chalef
2b414d6094 Remove User and Assistant exception from Preference prioritization 2025-10-30 12:53:05 -07:00
Daniel Chalef
a9f31e37d8 conductor-checkpoint-msg_01NLStrCDq7HZJy3pKyGSqxM 2025-10-30 12:46:57 -07:00
Daniel Chalef
2a76296426 conductor-checkpoint-msg_01Jk4ugkAqMs4iRYWwnaNAHR 2025-10-30 11:47:27 -07:00
Daniel Chalef
73e31599ef conductor-checkpoint-msg_01ELC9AyZZGry9tN4XKrwEM6 2025-10-30 11:29:38 -07:00
Daniel Chalef
58bad9b542 conductor-checkpoint-msg_01WRZxPMQYjNEjcFNTMzWYeL 2025-10-30 11:25:25 -07:00
Daniel Chalef
ca0092d510 conductor-checkpoint-msg_018FX6Mibr66cKLnpL84f2Js 2025-10-30 10:41:47 -07:00
Daniel Chalef
3bf50c56e4 conductor-checkpoint-msg_01Ji7gxCG4jR145rBAupwU49 2025-10-30 08:02:28 -07:00
Daniel Chalef
00b579ff17 conductor-checkpoint-msg_01Gn6qZrD3DZd8c6a6fmMap7 2025-10-30 08:00:23 -07:00
Daniel Chalef
a139fca369 conductor-checkpoint-msg_018dRGHW6fPNqJDN6eV6SpoH 2025-10-30 07:29:23 -07:00
Daniel Chalef
8332ec3aa9 conductor-checkpoint-msg_0127MeSvxWk8BLXjB5k3wDJY 2025-10-30 07:22:58 -07:00
Daniel Chalef
afd83123fe conductor-checkpoint-msg_01BHEPsv2EML14gFa6vkn1NP 2025-10-30 07:10:18 -07:00
Daniel Chalef
fa2cc39122 conductor-checkpoint-msg_01Qdskq96hJ6Q9DPg1h5Jjgg 2025-10-30 06:57:33 -07:00
Daniel Chalef
61c46e258c conductor-checkpoint-msg_01K7QC1X8iPiYaMdvbi7WtR5 2025-10-30 06:45:26 -07:00
Daniel Chalef
ae47a7087f conductor-checkpoint-msg_01SNsax9AwiCBFrC7Fpo7BNe 2025-10-29 23:39:54 -07:00
Daniel Chalef
79be1a3472 conductor-checkpoint-msg_01MGFAenMDnTX3H9HSZEbj2T 2025-10-29 23:30:49 -07:00
Daniel Chalef
62cb4175da conductor-checkpoint-msg_018d52yUXdPF48UBWPQdiB4W 2025-10-29 23:17:00 -07:00
Daniel Chalef
8c02683174 fix: Remove protected 'name' attribute from entity type models
Pydantic BaseModel reserves 'name' as a protected attribute. Removed
the 'name' attribute from dynamically created entity type models as
it's not needed - the entity type name is already stored as the class
name and dict key.

Fixed error: name cannot be used as an attribute for Requirement as
it is a protected attribute name.
2025-10-29 22:58:56 -07:00
Daniel Chalef
b434a6b680 fix: Convert entity_types from list to dict for Graphiti API
The Graphiti add_episode() API expects entity_types as a
dict[str, type[BaseModel]], not a list. Changed entity type
building to create a dictionary mapping entity names to their
Pydantic model classes.

Fixed error: 'list' object has no attribute 'items'

Changes:
- Build entity_types as dict instead of list in config processing
- Add fallback to convert ENTITY_TYPES list to dict if needed
- Map entity type names to their model classes
2025-10-29 22:51:24 -07:00
Daniel Chalef
d940b6fb7d fix: Use timezone.utc instead of UTC for Python 3.10 compatibility
The UTC constant was added in Python 3.11. Changed to use
timezone.utc which is available in Python 3.10+.

Fixed ImportError: cannot import name 'UTC' from 'datetime'
2025-10-29 22:46:17 -07:00
Daniel Chalef
12eb564eda fix: Resolve database connection and episode processing errors
Fixed two critical runtime errors:

1. Database connection check for KuzuDB
   - KuzuDB session.run() returns None, causing async iteration error
   - Added special handling for KuzuDB (in-memory, no query needed)
   - Other databases (Neo4j, FalkorDB) still perform connection test

2. Episode processing parameter error
   - Changed 'episode_type' parameter to 'source' to match Graphiti API
   - Added required 'reference_time' parameter with current timestamp
   - Added datetime imports (UTC, datetime)

Errors fixed:
- 'async for' requires an object with __aiter__ method, got NoneType
- Graphiti.add_episode() got an unexpected keyword argument 'episode_type'
2025-10-29 22:43:09 -07:00
Daniel Chalef
669aaae785 fix: Fix all linting errors in test suite
- Replace bare except with except Exception
- Remove unused imports and variables
- Fix type hints to use modern syntax
- Apply ruff formatting for line length
- Ensure all tests pass linting checks
2025-10-29 18:41:18 -07:00
Daniel Chalef
2037df875d fix: Configure consistent logging format between uvicorn and MCP server
- Use simplified format matching uvicorn's default (LEVEL message)
- Remove timestamps from custom logger format
- Suppress verbose MCP and uvicorn access logs
- Improve readability of server startup output

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 18:00:47 -07:00
Daniel Chalef
7a65f6729a fix: Correct MCP HTTP endpoint path from / to /mcp/
- Remove incorrect /status endpoint reference
- Update logging to show correct MCP endpoint at /mcp/
- Align with FastMCP documentation standards

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 17:54:41 -07:00
Daniel Chalef
91d515871b feat: Add detailed server URL logging and improve access information
- Added comprehensive logging showing exact URLs to access the MCP server
- Display localhost instead of 0.0.0.0 for better usability
- Show MCP endpoint, transport type, and status endpoint information
- Added visual separators to make server info stand out in logs

This helps users understand exactly how to connect to the MCP server
and troubleshoot connection issues.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 17:48:56 -07:00
Daniel Chalef
f3b793f244 fix: Update hardcoded default model to gpt-4.1 and fix config path
- Changed hardcoded default in schema.py from gpt-4o to gpt-4.1
- Fixed default config path to look in config/config.yaml relative to mcp_server directory
- This ensures the server uses gpt-4.1 as the default model everywhere

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 17:44:36 -07:00
Daniel Chalef
0f85119443 fix: Improve MCP server configuration and initialization
- Fix API key detection: Remove hardcoded OpenAI checks, let factories handle provider-specific validation
- Fix .env file loading: Search for .env in mcp_server directory first
- Change default transport to SSE for broader compatibility (was stdio)
- Add proper error handling with warnings for failed client initialization
- Model already defaults to gpt-4o as requested

These changes ensure the MCP server properly loads API keys from .env files
and creates the appropriate LLM/embedder clients based on configuration.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 17:31:32 -07:00
Daniel Chalef
21530c6408 feat: MCP Server v1.0.0rc0 - Complete refactoring with modular architecture
This is a major refactoring of the MCP Server to support multiple providers
through a YAML-based configuration system with factory pattern implementation.

## Key Changes

### Architecture Improvements
- Modular configuration system with YAML-based settings
- Factory pattern for LLM, Embedder, and Database providers
- Support for multiple database backends (Neo4j, FalkorDB, KuzuDB)
- Clean separation of concerns with dedicated service modules

### Provider Support
- **LLM**: OpenAI, Anthropic, Gemini, Groq
- **Embedders**: OpenAI, Voyage, Gemini, Anthropic, Sentence Transformers
- **Databases**: Neo4j, FalkorDB, KuzuDB (new default)
- Azure OpenAI support with AD authentication

### Configuration
- YAML configuration with environment variable expansion
- CLI argument overrides for runtime configuration
- Multiple pre-configured Docker Compose setups
- Proper boolean handling in environment variables

### Testing & CI
- Comprehensive test suite with unit and integration tests
- GitHub Actions workflows for linting and testing
- Multi-database testing support

### Docker Support
- Updated Docker images with multi-stage builds
- Database-specific docker-compose configurations
- Persistent volume support for all databases

### Bug Fixes
- Fixed KuzuDB connectivity checks
- Corrected Docker command paths
- Improved error handling and logging
- Fixed boolean environment variable expansion

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-26 17:23:57 -07:00