Skip to content

Conversation

@open-swe
Copy link

@open-swe open-swe bot commented Aug 12, 2025

Fixes #8

Overview

This PR completes a comprehensive migration of the retrieval graph system to use the new LangGraph Context API. The changes replace the previous RunnableConfig-based configuration pattern with a more streamlined context-based approach.

Key Changes

  • Updated Configuration and IndexConfiguration classes to support environment variable population and direct context usage
  • Modified node functions in graph.py and index_graph.py to use runtime: Runtime[Context] parameters
  • Updated retrieval functions to work with the new context API
  • Refactored integration and unit tests to demonstrate the new usage pattern
  • Updated README documentation to showcase the new context configuration approach

Migration Highlights

  • Removed from_runnable_config() methods
  • Added __post_init__() methods for environment variable handling
  • Replaced config_schema with context_schema
  • Updated function signatures to use runtime: Runtime[Context]
  • Simplified configuration access through runtime.context

Breaking Changes

  • Removed support for RunnableConfig-based configuration
  • Changed how configuration is passed to graph methods
  • Requires updates to existing code using the retrieval graph

Testing

  • All existing test cases have been updated and verified
  • Maintained full test coverage for user isolation and configuration handling
  • Demonstrated compatibility with different retriever providers

This PR represents a significant improvement in configuration handling and aligns the project more closely with the latest LangGraph Context API patterns.

@open-swe open-swe bot added the open-swe label Aug 12, 2025
@open-swe open-swe bot marked this pull request as ready for review August 12, 2025 14:48
@open-swe open-swe bot changed the title [WIP]: Implement LangGraph Context API to replace config['configurable'] pattern with Runtime[Context] and get_runtime() functions feat: Migrate to LangGraph Context API Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement LangGraph Context API in Project

3 participants