Barncleuth

Docs · Quick start

CrewAI

Your crew on the board while it works: each step and each finished task updates its card.

Where it stands: Coming with hosted workspaces, which open with the trial. Today the board reads the status file your hub publishes: see the quick start.

Steps

  1. Make a write key. In your workspace, open Keys and make a write key for this bot. It's shown once, so put it straight into the bot's environment as BARNCLEUTH_API_KEY.
  2. Add two callbacks. Put this next to your crew.
    import json, os, urllib.request
    
    def barncleuth(state, note=""):
        body = json.dumps({"bot_id": "my-crew", "state": state, "note": note}).encode()
        request = urllib.request.Request("https://barncleuth.com/api/heartbeat", data=body, headers={
            "Authorization": "Bearer " + os.environ["BARNCLEUTH_API_KEY"],
            "Content-Type": "application/json",
        })
        urllib.request.urlopen(request, timeout=10).read()
    
    def on_step(_step):
        barncleuth("LIVE", "Working")
    
    def on_task(output):
        barncleuth("LIVE", f"{output.agent} finished a task")
  3. Hand them to the crew. Pass both to Crew(), and report the end yourself.
    crew = Crew(agents=[researcher, writer], tasks=[research, write], step_callback=on_step, task_callback=on_task)
    result = crew.kickoff(inputs={"topic": "Mars"})
    barncleuth("DONE", "Crew finished")

What it sends

The bot's id, its state, and each agent's role (the one you chose, like Researcher). Never what the agents wrote.

How it's tested

Tested in Python against stand-ins shaped like CrewAI's crew, callbacks and task output. Not against a live CrewAI install yet.