Hi Agno team and community,
I’m using the Agent class and running into a few issues with one Agent.run() call for my query (“how many refunds i did”). I’d really appreciate your help with these:
- Why does it call the model four times (token counts: 4,861, 3,700, 2,601, 2,665) for one query?
- I set num_history_responses=2, but it’s adding 4 messages from history—why isn’t it capping at 2?
- I’m using ~9,600 tokens total—any tips on reducing this to fewer tokens (maybe ~1,000)?
- I tried adding table schemas to the knowledge base instead of the prompt, but the accuracy got worse—any advice?
Here’s my setup and logs with some extra debugging. Thanks so much for any insights or suggestions!
Here’s my config:
@dataclass
class Config:
model: str = gpt-4o-mini
retries: int =3
stream: bool = True
num_history_responses: int = 2
add_history_to_messages: bool = True
read_chat_history: bool = True
read_tool_call_history: bool = False
add_references: bool = False
num_documents: int =2
debug_mode: bool = True
create_user_memories: bool = True
update_user_memories_after_run: bool = False
create_session_summary: bool = False
update_session_summary_after_run: bool = False
add_datetime_to_instructions = True
Here’s my logs: