When I switched to async mode the Postgres storage does not work anymore.
The sqlite storage still works
Hi @selectcode
Thanks for reaching out and for using Agno! I’ve looped in the right engineers to help with your question. We usually respond within 24 hours, but if this is urgent, just let us know, and we’ll do our best to prioritize it.
Appreciate your patience—we’ll get back to you soon!
Hey @selectcode! Can you please share the code with me so that I reproduce this on my end?
Yes, take a look here. When I exchange the agent storage trough the sqlite plugin it can remember a fictional name, that I told him. When I switch back to posgres, the agent can not see the previous message.
I recreate the agent with every message to keep it stateless so far.
# Create new agent on new prompt
agent = Agent(
model=openai, #claude
#storage=SqliteAgentStorage(table_name="agent_sessions", db_file="tmp/agent_storage.db"),
storage=PostgresAgentStorage(table_name="personalized_agent_sessions", db_url=db_url, auto_upgrade_schema=True),
show_tool_calls=False,
markdown=False,
session_id=user.id + "_whatsapp",
user_id=user.id,
add_history_to_messages=True,
read_tool_call_history=True,
num_history_responses=5,
tools=[personal_toolkit, task_toolkit], # Add both toolkits
#read_chat_history=True,
telemetry=False,
instructions=prompt,
debug_mode=True
)
await user_agent.arun(user_text)
@manthanguptaa does that help you? Or do you need more context from us?
Is there an error you are running into or the insertion doesn’t work at all?
It doesn’t work at all
@manthanguptaa I got the error - the database was missing a column and the database adapter did not create it automatically even though auto_upgrade_schema=True
@selectcode At the moment auto_upgrade_schema
param doesn’t do anything. We have to implement it, and it’s on our roadmap. Sadly if you are missing a column.You will have to delete the table and let it run again
I encountered the same issue. Since I was working on the table in production, I couldn’t just delete it and rebuild it from scratch and this is not a good soloution for a Agno-user with many customers! (I think the Agno team should develop Agno to be more reliable and backward compatible).
The main issue was that in the new version, an extra_data
column with jsonb
format was added to the table. If you manually add this column to the table, the issue will be resolved.
Hey @esmln, I’m really sorry for the less than ideal experience with Agno. We truly appreciate your feedback and are continuously working to make Agno a better and more reliable framework. Your insights help us improve, and we’re committed to making it more production ready. Thanks for your patience and support. It really means a lot!