Skip to content

Feature/new context retrieval strategy#92

Merged
dcloud347 merged 8 commits into
mainfrom
feature/new-context-retrieval-strategy
Jul 27, 2025
Merged

Feature/new context retrieval strategy#92
dcloud347 merged 8 commits into
mainfrom
feature/new-context-retrieval-strategy

Conversation

@dcloud347

Copy link
Copy Markdown
Contributor

This pull request introduces significant changes to the prometheus codebase, focusing on improving the context retrieval workflow, enhancing exception handling, and refining utility functions. The most notable updates include replacing the context selection process with a new context extraction mechanism, introducing a base exception class for file operations, and updating graph traversal functions to return richer data structures.

Context Retrieval Workflow Enhancements:

  • Replaced the ContextSelectionNode with a newly implemented ContextExtractionNode, which extracts concise and relevant code snippets based on structured output models. This includes adding the ContextExtractionNode class and its supporting logic in prometheus/lang_graph/nodes/context_extraction_node.py.
  • Updated the ContextRetrievalSubgraph to integrate the ContextExtractionNode in place of the ContextSelectionNode, modifying the workflow and its edge connections accordingly [1] [2] [3] [4] [5].

Exception Handling Improvements:

  • Added a new FileOperationException base class in prometheus/exceptions/file_operation_exceptions.py to standardize exception handling for file-related operations.

Utility and Graph Traversal Updates:

  • Updated several graph traversal functions in prometheus/tools/graph_traversal.py to return tuples containing a string and a sequence of mappings, enabling richer data handling for file and AST node queries [1] [2] [3] [4] [5] [6].
  • Introduced a new utility import pre_append_line_numbers in prometheus/tools/graph_traversal.py for line number processing.

Prompt and Documentation Refinements:

  • Improved the system prompt in ContextProviderNode to clarify its role in understanding project logic and fixed minor typos in the prompt text [1] [2] [3].
  • Adjusted the formatting of the system prompt in ContextRefineNode to escape curly braces and improve clarity.

Codebase Simplification:

  • Removed the deprecated ContextSelectionNode and its associated logic from prometheus/lang_graph/nodes/context_selection_node.py, simplifying the codebase.

These changes collectively enhance the robustness, clarity, and functionality of the context retrieval system while improving maintainability and error handling.

@dcloud347 dcloud347 merged commit 0c55429 into main Jul 27, 2025
2 checks passed
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.

1 participant