Agent • AI Agent SDK
Agent: Create an agent with session context.
Agent
Method
</div>
This is a method of the Session class in the session module.
Create an agent with session context.
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#8B0000', 'primaryTextColor': '#fff', 'primaryBorderColor': '#710101', 'lineColor': '#189AB4', 'secondaryColor': '#189AB4', 'tertiaryColor': '#fff' }}}%%
graph LR
input["Input Data"] --> agent["Agent: Agent"]
agent --> output["Output Result"]
style agent fill:#8B0000,color:#fff
style input fill:#8B0000,color:#fff
style output fill:#8B0000,color:#fffSignature
def Agent(name: str, role: str, instructions: Optional[str], tools: Optional[List[Any]], memory: bool, knowledge: Optional[List[str]]) -> AgentParameters
ParamField
strAgent name
ParamField
strAgent role
ParamField
OptionalAgent instructions
ParamField
OptionalList of tools for the agent
ParamField
boolEnable memory for the agent
ParamField
OptionalKnowledge sources for the agent **kwargs: Additional agent parameters
Returns
ResponseField
AgentConfigured Agent instance
Exceptions
ValueError
If this is a remote session (use chat() instead)
Uses
ValueErrorAgent
Used By
ContextAgent.analyze_codebase_with_gitingestContextAgent.perform_ast_analysisContextAgent.extract_implementation_patternsContextAgent.analyze_test_patternsContextAgent.generate_comprehensive_prp
Source
View on GitHubpraisonaiagents/session.py at line 133