@@ -8,16 +8,17 @@ class Agent(BaseModel):
8
8
name : str
9
9
role : str
10
10
description : str
11
+ llm : Any = Field (description = "Language model for the agent" )
11
12
12
13
class PlannerAgent (Agent ):
13
14
"""Agent responsible for breaking down problems and planning steps"""
14
15
def __init__ (self , llm ):
15
16
super ().__init__ (
16
17
name = "Planner" ,
17
18
role = "Strategic Planner" ,
18
- description = "Breaks down complex problems into manageable steps"
19
+ description = "Breaks down complex problems into manageable steps" ,
20
+ llm = llm
19
21
)
20
- self .llm = llm
21
22
22
23
def plan (self , query : str , context : List [Dict [str , Any ]] = None ) -> str :
23
24
if context :
@@ -51,14 +52,16 @@ def plan(self, query: str, context: List[Dict[str, Any]] = None) -> str:
51
52
52
53
class ResearchAgent (Agent ):
53
54
"""Agent responsible for gathering and analyzing information"""
55
+ vector_store : Any = Field (description = "Vector store for searching" )
56
+
54
57
def __init__ (self , llm , vector_store ):
55
58
super ().__init__ (
56
59
name = "Researcher" ,
57
60
role = "Information Gatherer" ,
58
- description = "Gathers and analyzes relevant information from knowledge bases"
61
+ description = "Gathers and analyzes relevant information from knowledge bases" ,
62
+ llm = llm ,
63
+ vector_store = vector_store
59
64
)
60
- self .llm = llm
61
- self .vector_store = vector_store
62
65
63
66
def research (self , query : str , step : str ) -> List [Dict [str , Any ]]:
64
67
# Query all collections
@@ -96,9 +99,9 @@ def __init__(self, llm):
96
99
super ().__init__ (
97
100
name = "Reasoner" ,
98
101
role = "Logic and Analysis" ,
99
- description = "Applies logical reasoning to information and draws conclusions"
102
+ description = "Applies logical reasoning to information and draws conclusions" ,
103
+ llm = llm
100
104
)
101
- self .llm = llm
102
105
103
106
def reason (self , query : str , step : str , context : List [Dict [str , Any ]]) -> str :
104
107
template = """You are a reasoning agent. Your role is to apply logical analysis to information and draw conclusions.
@@ -127,9 +130,9 @@ def __init__(self, llm):
127
130
super ().__init__ (
128
131
name = "Synthesizer" ,
129
132
role = "Information Synthesizer" ,
130
- description = "Combines multiple pieces of information into a coherent response"
133
+ description = "Combines multiple pieces of information into a coherent response" ,
134
+ llm = llm
131
135
)
132
- self .llm = llm
133
136
134
137
def synthesize (self , query : str , reasoning_steps : List [str ]) -> str :
135
138
template = """You are a synthesis agent. Your role is to combine multiple pieces of information into a clear, coherent response.
0 commit comments