Hi everyone,
I’m experiencing an issue where the playground does not save my interactions with the agents created in the ‘Sessions’ menu. I’ve tried everything, including downgrading my Agno version and accessing the playground with a different Google account, but the problem still persists.
Hi @paulodavism, thanks for reaching out and supporting Agno. I’ve shared this with the team, we’re working through all requests one by one and will get back to you soon.
If it’s urgent, please let us know. We appreciate your patience!
Hi @paulodavism ,
Can you please share your agent config to help me replicate the issue ?
Also make sure you are using the recent Agno version .
Thanks
I have the same issue. Tried everything.
Hi @camilodamiao , Can you please share your agent config to help me replicate the issue ?
Thanks
I have found some problems using playground, now I can bring more details.
Simply logging in app.agno.com does not makes you “logged in” sometimes, it seems like a bug to me. When I included the agno api key in the .env file in my project, the sessions started to be saved and I could have the historical data in the dashboard and sessions.
Also, when I disconnect from the playground and reconnect to it, Agno creates a new “agent id” in the storage connected to the agent, and in the newest agno version, it seems that playground filters somehow the sessions by agent id and you can only visualize the sessions in the playground from the current “connection”, which have the same agent id. If you disconnect and connect again, as agno creates a new agent id in the table and it is not possible to force a fixed agent id, you cannot retrieve old sessions, unless you edit the agent id for the current one that agno created.
But in agno 1.5.0, it seems that there is no filter, and it is possible to retrieve all old sessions.
This is the behavior that I noticed in my tests here.
my project is simple.
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.playground import Playground, serve_playground_app
from agno.storage.postgres import PostgresStorage
from agno.memory.v2.memory import Memory
from agno.memory.v2.db.postgres import PostgresMemoryDb
from dotenv import load_dotenv
import os
# Carregar variáveis
load_dotenv()
# ÂNCORA: AGENT_ID_FIXO - Mantém consistência entre reinicializações
# Contexto: Sem ID fixo, cada restart cria novo agent_id e perde sessões anteriores
# Cuidado: Em produção, cada cliente deve ter seu próprio agent_id
# Dependências: Playground filtra sessões por agent_id
FIXED_AGENT_ID = “secretaria-quiro-001”
db_url = os.getenv(“DATABASE_URL”)
print(f" Conectando ao PostgreSQL…")
# Criar storage para sessões do agente
try:
agent_storage = PostgresStorage(
table_name="agent_sessions",
schema="agno",
db_url=db_url,
auto_upgrade_schema=True
)
print("✅ Storage do agente configurado!")
except Exception as e:
print(f"❌ Erro ao configurar storage: {e}")
agent_storage = None
# Criar storage para memórias
try:
memory_db = PostgresMemoryDb(
table_name="user_memories",
schema="agno",
db_url=db_url
)
memory = Memory(db=memory_db)
print("✅ Memory storage configurado!")
except Exception as e:
print(f"❌ Erro ao configurar memory: {e}")
memory = None
# Criar o agente com storage e ID FIXO
agent = Agent(
name=os.getenv("AGENT_NAME", "secretaria_quiro"),
agent_id=FIXED_AGENT_ID, # IMPORTANTE: ID fixo!
model=OpenAIChat(id="gpt-4o-mini"),
description="Você é uma secretária virtual prestativa e profissional de uma clínica de quiropraxia.",
instructions=\[
"Responda de forma clara, objetiva e cordial",
"Use linguagem profissional mas amigável",
"Seja concisa nas respostas",
"Lembre-se de informações importantes sobre os pacientes"
\],
tools=\[\],
show_tool_calls=True,
markdown=True,
storage=agent_storage,
memory=memory,
enable_user_memories=True,
add_history_to_messages=True,
debug_mode=True,
monitoring=True,
num_history_runs=10
)
print(f" Agent ID: {agent.agent_id}")
# Criar playground
app = Playground(agents=[agent]).get_app()
if _name_ == “_main_”:
print("🚀 Iniciando Playground com PostgreSQL Storage!")
print(f"📍 Acesse: http://localhost:7777")
print(f"🆔 Agent ID fixo: {FIXED_AGENT_ID}")
print(f"🧠 Memórias persistentes ativadas!")
serve_playground_app("playground_with_storage:app", host="0.0.0.0", port=7777, reload=True)
Hi @camilodamiao , To persist the session upon disconnecting and connecting again you will have to give an agent_id
in the agent config , otherwise it will create a new instance of the agent everytime .
You can either do ag setup for a cli login or set the api key . It should log your session if logging is turned on in playground.
Thanks