-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Feat/additional context #2021
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/additional context #2021
Conversation
* Add support for additional context for PipelineState * Clean up * Clean up * Clean up * Nit --------- Co-authored-by: Snehit Gajjar <[email protected]>
Co-authored-by: Copilot <[email protected]>
Given that this is essentially just providing a way to pre-set some values in the context.json if it doesn't already exist, what would you think about naming it init_context or something like that, and then if present it just becomes the state from context.json instead of trying to read it? |
Thanks for the suggestion, @natoverse.
Because those two buckets serve different purposes (ephemeral vs. persisted), renaming to init_context and overriding the whole JSON file would conflate them. If we still feel the name is confusing, I’m open to alternatives—maybe something like runtime_context or volatile_context to emphasise its non-persistent nature. Let me know what you think! |
Ok, that makes sense. I had thought you may be planning to allow non-serializable objects, but don't see where we exclude it when context.json is dumped. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for passing additional context to GraphRAG pipeline runs through a new additional_context
parameter. This enables custom workflows to access user-defined parameters during pipeline execution.
- Adds
additional_context
parameter to both API and pipeline execution layers - Stores additional context in pipeline state under
additional_context
key - Excludes additional context from persisted state to avoid potential serialization issues
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
graphrag/api/index.py |
Adds additional_context parameter to build_index API function with documentation |
graphrag/index/run/run_pipeline.py |
Implements additional context storage in pipeline state and excludes it from JSON serialization |
.semversioner/next-release/minor-20250807204918927024.json |
Version bump configuration for minor release |
Description
Add additional_context dictionary bag at api level for custom workflows support
Related Issues
[Reference any related issues or tasks that this pull request addresses.]
Proposed Changes
[List the specific changes made in this pull request.]
Checklist
Additional Notes
[Add any additional notes or context that may be helpful for the reviewer(s).]