Skip to content

Conversation

luan122
Copy link

@luan122 luan122 commented Sep 12, 2025

Summary

Complete VS Code models integration for Graphiti, adding native VS Code language model and embedding support as an optional dependency package graphiti-core[vscodemodels].

Type of Change

  • Bug fix
  • New feature
  • Performance improvement
  • Documentation/Tests

Objective

For new features and performance improvements:

This PR adds native VS Code models integration to Graphiti, enabling users to leverage VS Code's built-in AI capabilities without requiring external API keys or services. The integration follows the established pattern of other LLM providers (anthropic, google-genai, etc.) and provides:

  • Zero External Dependencies: Works entirely within VS Code using native language model APIs
  • Intelligent Fallbacks: Graceful degradation when VS Code models are unavailable
  • Consistent API: Follows the same patterns as existing LLM providers
  • MCP Server Support: Full integration with the Model Context Protocol server
  • 1024-dimensional Embeddings: Consistent vector representations with semantic clustering fallbacks

This addresses the need for developers working within VS Code to use Graphiti without setting up external LLM services, making the framework more accessible for local development and experimentation.

Testing

  • Unit tests added/updated (validation script: examples/vscode_models/validate_integration.py)
  • Integration tests added/updated (basic usage example: examples/vscode_models/basic_usage.py)
  • All existing tests pass (validation confirms imports and initialization work correctly)

Breaking Changes

  • This PR contains breaking changes

No breaking changes - this is a purely additive feature that doesn't modify existing functionality.

Checklist

  • Code follows project style guidelines (follows existing LLM client patterns)
  • Self-review completed
  • Documentation updated where necessary (README.md, MCP server docs, examples)
  • No secrets or sensitive information committed

Related Issues

Closes #907


Implementation Details

New Files Added:

  • graphiti_core/llm_client/vscode_client.py - VS Code LLM client with native integration
  • graphiti_core/embedder/vscode_embedder.py - VS Code embedder with fallback support
  • examples/vscode_models/basic_usage.py - Complete usage example
  • examples/vscode_models/validate_integration.py - Integration validation tests
  • examples/vscode_models/README.md - Comprehensive usage guide

Modified Files:

  • pyproject.toml - Added vscodemodels = [] optional dependency
  • README.md - Added "Using Graphiti with VS Code Models" section
  • mcp_server/README.md - Added VS Code configuration documentation
  • graphiti_core/llm_client/__init__.py - Added VSCodeClient export
  • graphiti_core/embedder/__init__.py - Added VSCodeEmbedder exports

Key Features:

  • Native VS Code Integration: Direct API calls to VS Code language models
  • Automatic Model Detection: Detects available VS Code models automatically
  • Fallback System: Semantic chunking when embeddings unavailable
  • Batch Processing: Efficient embedding generation
  • Configuration Options: Customizable models and dimensions
  • MCP Server Ready: Full Model Context Protocol support

Installation:

pip install "graphiti-core[vscodemodels]"

@danielchalef
Copy link
Member

danielchalef commented Sep 12, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@luan122
Copy link
Author

luan122 commented Sep 12, 2025

I have read the CLA Document and I hereby sign the CLA

danielchalef added a commit that referenced this pull request Sep 12, 2025
- Add VSCodeClient with native VS Code LLM integration
- Add VSCodeEmbedder with 1024-dim embeddings and fallbacks
- Create graphiti-core[vscodemodels] optional dependency
- Add comprehensive documentation and examples
- Update README with VS Code models section
- Add MCP server VS Code configuration
- Include validation tests and troubleshooting guides
- Zero external dependencies - works entirely within VS Code

Package ready for: pip install 'graphiti-core[vscodemodels]'
Copy link
Author

@luan122 luan122 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pushed commit with gpg key

AIXerum pushed a commit to AIXerum/graphiti that referenced this pull request Sep 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Uses VSC Copilot models

2 participants