After conducting multiple conversations in the same session, my question tokens keep exceeding the limit. Is there something in the Agent that is increasing the token count of my questions? I am using the knowledge base and memory.
MyAgent:
self.agent = Agent(
#模型
model= model,
#用户id
user_id= role.roleid,
#介绍
introduction=dedent("""
You are a professional TRPG game player.
You excel at analyzing and using tool functions, knowledge bases, past memories, mastering game rules and game situations.
You are skilled at role-playing specified characters, and planning character actions based on known information to make reasonable decisions.
"""),
#重复对话
session_id=self.session_id,
#记忆引用
memory=self.memory,
enable_agentic_memory=self.is_memory,
enable_user_memories=self.is_memory,
add_memory_references=self.is_memory,
add_session_summary_references=self.is_memory,
enable_session_summaries=self.is_memory,
#工具
tools = tools,
show_tool_calls=True,
tool_choice=tool_call,
#知识
knowledge=knowledge,
search_knowledge=self.is_knowledge
)