"""Example showing how to pass extra configuration to your AgentOS."""
from agno.agent import Agent
from agno.db.postgres import PostgresDb
from agno.models.openai import OpenAIChat
from agno.os import AgentOS
from agno.team import Team
from agno.workflow.step import Step
from agno.workflow.workflow import Workflow
from pathlib import Path
# Get the path to our configuration file
cwd = Path(__file__).parent
config_file_path = str(cwd.joinpath("configuration.yaml"))
# Setup the database
db = PostgresDb(db_url="postgresql+psycopg://ai:ai@localhost:5532/ai")
# Setup basic agents, teams and workflows
basic_agent = Agent(
name="Basic Agent",
db=db,
enable_session_summaries=True,
enable_user_memories=True,
add_history_to_context=True,
num_history_runs=3,
add_datetime_to_context=True,
markdown=True,
)
basic_team = Team(
id="basic-team",
name="Basic Team",
model=OpenAIChat(id="gpt-5-mini"),
db=db,
members=[basic_agent],
enable_user_memories=True,
)
basic_workflow = Workflow(
id="basic-workflow",
name="Basic Workflow",
description="Just a simple workflow",
db=db,
steps=[
Step(
name="step1",
description="Just a simple step",
agent=basic_agent,
)
],
)
# Setup our AgentOS app
agent_os = AgentOS(
description="Example AgentOS",
agents=[basic_agent],
teams=[basic_team],
workflows=[basic_workflow],
# We pass the configuration file to our AgentOS here
config=config_file_path,
)
app = agent_os.get_app()
if __name__ == "__main__":
"""Run our AgentOS.
You can see the configuration and available apps at:
http://localhost:7777/config
"""
agent_os.serve(app="agentos_extra_configuration:app", reload=True)