MythOS Docs
X
  • Introduction to MythOS
  • Core Components of MythOS
  • How MythOS Simulations Work
  • Why MythOS is More Than a Simulator
  • Example: Building a MythOS Simulation
  • Conclusion
  • Next Steps
Powered by GitBook
On this page

Example: Building a MythOS Simulation

Here’s a practical example of how to create and interact with a MythOS agent using Python. This snippet demonstrates the creation of a Product Manager agent in a startup simulation.

from mythos import Agent, Simulation

# Initialize a simulation
sim = Simulation(scenario="Startup in Crisis")

# Create an agent
product_manager = Agent(
    role="Product Manager",
    traits=["analytical", "conflict-avoidant"],
    goals=["improve team morale", "launch new feature"]
)

# Agent observes the environment
context = product_manager.observe_environment()
print(context)
# Output: "Team morale is low. Resources are limited. Deadline approaching."

# Agent communicates with the CEO
response = product_manager.speak_to(agent="CEO", message="Propose team-building event to boost morale.")
print(response)
# Output: "CEO: Approved, but keep costs under $500."

# Agent adapts strategy based on feedback
product_manager.modify_strategy(new_priority="cost-effective morale boost")
PreviousWhy MythOS is More Than a SimulatorNextConclusion

Last updated 2 days ago