A framework for creating, managing, and executing a chain of agents in a graph-like structure.
You can install the library using pip:
pip install Orbitfrom Orbit import Agent
# Define an Agent
agent = Agent(name, instructions, llm_model, input_keys, output_key)name: Name of the agent.instructions: Prompt instructions for the agent.llm_model: Language model for the agent.input_keys: List of input keys.output_key: Output key.
from Orbit import Route
# Define a Route
route = Route(from_agent, to_agents, route_logic=None)from_agent: Name of the source agent.to_agents: List of destination agent names.route_logic: Route logic.
from Orbit import Flow
# Define a Flow
flow = Flow(name="MyGraph")name: Name of the flow.
# Add Agents to the Flow
flow.add_agent(agent)
# Add Routes to the Flow
flow.add_route(route)# Set the entry point of the flow
flow.set_entry_point(agent_name)
# Compile the flow
flow.compile()# Define initial state
initial_state = {...}
# Run the flow
final_state = flow.run(initial_state)# Save the flow configuration
flow.save_flow(filename)
# Load the flow configuration
loaded_flow = Flow.load_flow(filename)