Deterministic runtime and ACID tool sandbox for multi-agent systems.
Project details
JUKEBOX-OS is a versatile environment designed to provide a 24-hour deterministic runtime for agents. It features a Copy-on-Write ACID tool sandbox and a time-travel mechanism, catering to the needs of multi-agent systems built in Rust and Python. Explore new possibilities in agent interactions and system behaviors with a reliable and advanced framework.
JUKEBOX-OS combines the power of deterministic flight-recording with an ACID-compliant sandbox runtime for autonomous agents in a multi-agent ecosystem. Built with Rust and linked to Python, this innovative project provides developers and engineers with the tools needed to manage complex workflows without the fear of side effects ruining production data integrity.
JUKEBOX introduces several compelling features that enhance the functioning of agent frameworks:
🔄 Vinyl CAS Flight-Recorder: Captures every interaction with machine learning models, ensuring that all requests, outputs, and time events are stored in a cryptographic .jbx tape. Replay agent executions at lightning speed, allowing for debugging without incurring API costs.
🛠️ Shadow Booth ACID Tool Sandbox: Prevents unverified operations from affecting live systems, only committing changes when verified by the developer, thus preserving data integrity and safety.
⏳ Time-Travel Forking: Facilitates adjustments and replays of past executions, making it possible to experiment and iterate on previous agent decisions without side effects.
🚨 Anti-Skip Needle (Loop Circuit-Breaker): Monitors and prevents recursive agent loops, safeguarding against unnecessary cloud costs and runaway resource consumption.
Start harnessing the power of JUKEBOX by tracking an agent's actions and enabling robust transaction capabilities:
import asyncio
from jukebox import Jukebox, SandboxPolicy, CircuitBreaker
jb = Jukebox(
tape_dir="./tapes",
sandbox=SandboxPolicy(filesystem="copy_on_write", mcp_mode="staged_acid"),
breaker=CircuitBreaker(max_cost_usd=0.50, max_semantic_repeat=3),
)
@jb.track(name="invoice-reconciliation-agent")
async def run_accounting_agent(customer_id: str, amount_usd: float) -> dict:
async with jb.transaction(tape_id="tr_8f92a1c4") as tx:
tx.record_agent_turn(
agent_name="planner",
message=f"Staging refund of ${amount_usd} for {customer_id}",
model="gpt-4o",
cost_usd=0.008,
)
tx.stage_file_write(
path="./tapes/staged_ledger_demo.json",
content=f'{{"customer": "{customer_id}", "refund_usd": {amount_usd}}}',
)
if amount_usd > 500.0:
await tx.rollback(reason="Refund exceeds $500 autonomous threshold")
return {"status": "ROLLED_BACK", "tape_id": tx.tape_id}
await tx.commit()
return {"status": "COMMITTED", "tape_id": tx.tape_id}
if __name__ == "__main__":
print(asyncio.run(run_accounting_agent("cust_9981", 420.00)))
The architecture of JUKEBOX-OS is designed to integrate seamlessly into existing agent frameworks such as LangGraph, AutoGen, CrewAI, and others. It ensures that operations are executed predictably while providing a structured method for handling state changes.
Development of JUKEBOX-OS is collaborative, with community contributions welcomed. Interested users can participate and help enhance the project further by following contribution guidelines.
Explore the repository to see how JUKEBOX-OS can improve the robustness of workflows within multi-agent systems and mitigate risks associated with unexpected behaviors.
Comments
0Start the conversation
Share the first comment.