@@ -68,7 +68,8 @@ class ContextRetrievalSubgraph:
6868
6969 def __init__ (
7070 self ,
71- model : BaseChatModel ,
71+ base_model : BaseChatModel ,
72+ advanced_model : BaseChatModel ,
7273 kg : KnowledgeGraph ,
7374 local_path : str ,
7475 repository_id : int ,
@@ -77,19 +78,20 @@ def __init__(
7778 Initializes the context retrieval subgraph.
7879
7980 Args:
80- model (BaseChatModel): The LLM used for context selection and refinement.
81+ base_model (BaseChatModel): The LLM used for context selection and refinement.
82+ advanced_model (BaseChatModel): The LLM used for advanced tasks like query refinement and context extraction.
8183 kg (KnowledgeGraph): Knowledge graph instance
8284 local_path (str): Local path to the codebase for context extraction.
8385 repository_id (int): Repository ID for memory storage
8486 """
8587 # Step 1: Refine query into structured format
86- context_refine_node = ContextRefineNode (model = model , kg = kg )
88+ context_refine_node = ContextRefineNode (model = advanced_model , kg = kg )
8789
8890 # Step 2: Retrieve contexts from semantic memory (Athena)
8991 memory_retrieval_node = MemoryRetrievalNode (repository_id = repository_id )
9092
9193 # Step 3: Extract relevant contexts from explored_context
92- context_extraction_node = ContextExtractionNode (model = model , root_path = local_path )
94+ context_extraction_node = ContextExtractionNode (model = advanced_model , root_path = local_path )
9395
9496 # Step 4: Store new contexts to memory
9597 memory_storage_node = MemoryStorageNode (repository_id = repository_id )
@@ -101,7 +103,7 @@ def __init__(
101103 add_context_refined_query_message_node = AddContextRefinedQueryMessageNode ()
102104
103105 # Step 7: Query knowledge graph (Neo4j) using LLM tools
104- context_provider_node = ContextProviderNode (model = model , kg = kg , local_path = local_path )
106+ context_provider_node = ContextProviderNode (model = base_model , kg = kg , local_path = local_path )
105107 context_provider_tools = ToolNode (
106108 tools = context_provider_node .tools ,
107109 name = "context_provider_tools" ,
0 commit comments