from upsonic import Task, Agent
# Two SQLite servers for different databases
class UsersDB:
command = "uvx"
args = ["mcp-server-sqlite", "--db-path", "/tmp/users.db"]
tool_name_prefix = "users_db" # Tools become: users_db_create_table, etc.
class OrdersDB:
command = "uvx"
args = ["mcp-server-sqlite", "--db-path", "/tmp/orders.db"]
tool_name_prefix = "orders_db" # Tools become: orders_db_create_table, etc.
task = Task(
description="""
Use 'users_db_*' tools to work with the users database.
Use 'orders_db_*' tools to work with the orders database.
Create tables in both and insert sample data.
""",
tools=[UsersDB, OrdersDB]
)
agent = Agent(name="Multi-DB Agent", model="openai/gpt-4o")
result = agent.do(task)