from agno.agent import Agent
from agno.db.postgres import PostgresDb
from agno.learn import LearningMachine
from agno.models.openai import OpenAIResponses
agent = Agent(
model=OpenAIResponses(id="gpt-5.2"),
db=PostgresDb(db_url="postgresql+psycopg://ai:ai@localhost:5532/ai"),
learning=LearningMachine(entity_memory=True),
)
# Entities are extracted automatically
agent.print_response(
"Just met with Acme Corp. They're a fintech startup in SF, "
"50 employees. CTO is Jane Smith. They use Python and Postgres.",
user_id="sales@example.com",
session_id="session_1",
)
# Later, entity knowledge is recalled
agent.print_response(
"What do we know about Acme Corp?",
user_id="sales@example.com",
session_id="session_2",
)