INTEGRATIONS / FROM ADAPTER TO CI

Connect your agent.
Replay its tool calls.

RunLedger launches your agent as a subprocess. A small JSONL adapter sends tool requests to the runner and receives recorded responses during replay.

Python or Node.jsNo model key for these startersRecord → replay → required check
01

Start with a working adapter

Use a new, empty project directory. Have Python 3.9+ available as python and pipx installed. The Node starter also needs Node.js 20+. Both examples use the built-in local search_docs tool.

Initialize a new project
Terminal
pipx install runledger
runledger init

Need a virtual environment instead? Follow the installation walkthrough, then return here after runledger init.

PYTHON · STANDARD LIBRARY

Python adapter

Replaces the generated demo agent. It requests a tool call, reads the returned search result, and emits a structured answer.

Download the Python adapter
Terminal
python -c "from urllib.request import urlretrieve; urlretrieve('https://runledger.io/templates/integrations/agent.py', 'evals/demo/agent/agent.py')"
NODE.JS · BUILT-IN MODULES

Node.js adapter

Adds the JavaScript agent and replaces the generated demo suite with a configuration that runs node agent/agent.mjs.

Download the Node adapter and suite
Terminal
python -c "from urllib.request import urlretrieve; urlretrieve('https://runledger.io/templates/integrations/agent.mjs', 'evals/demo/agent/agent.mjs'); urlretrieve('https://runledger.io/templates/integrations/node-suite.yaml', 'evals/demo/suite.yaml')"

Choose one starter per project. The download commands replace files in the newly generated demo; use a separate directory for each language.

02

Record, promote, then replay

The same commands work for either starter. The adapter consumes the tool response in both modes; replay serves that response from the cassette.

Record the local tool response
Terminal
runledger run ./evals/demo --mode record
Expected resultCase t1: PASS · process exit code 0
Promote the passing run
Terminal
runledger baseline promote --from RUN_DIR --to baselines/demo.json
Replace RUN_DIR before running

Use the exact artifacts directory printed by the record command. Put it in double quotes if the path contains spaces. This saves the passing run as your comparison baseline.

Replay and check the baseline
Terminal
runledger run ./evals/demo --mode replay --baseline baselines/demo.json

Expect PASS again. Open report.html inside the newly printed artifacts directory. To see a failed check, add next_steps to your schema's required fields and replay; the agent does not return it, so the process exits with code 1.

03

Run the same check on a PR

Commit the adapter, suite, cases, schema, cassette, and passing baseline. This workflow installs both runtimes, so it supports either starter.

Save as .github/workflows/runledger.yml
YAML
name: RunLedger
on:
  pull_request:
  workflow_dispatch:
jobs:
  agent-check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.11"
      - uses: actions/setup-node@v4
        with:
          node-version: "22"
      - run: python -m pip install runledger
      - name: Replay and check the baseline
        run: runledger run ./evals/demo --mode replay --baseline baselines/demo.json
      - name: Save reports
        if: always()
        uses: actions/upload-artifact@v4
        with:
          name: runledger-report
          path: runledger_out/**
Require the check to block merges

Configure your repository's branch protection or ruleset to require agent-check. A failing command fails the workflow; RunLedger does not configure repository rules for you.

04

Bridge your own tool dispatch

Keep your framework and add an adapter around the tool boundary. The runner needs each tool request and its arguments to record or replay that call.

  1. 1
    Receive task_start

    Read the case input from a JSON line on stdin.

  2. 2
    Send tool_call

    Emit the tool name, arguments, and a unique call_id on stdout.

  3. 3
    Consume tool_result

    Match the response by call_id and pass it back to your agent's tool node or dispatcher.

  4. 4
    Send final_output

    Emit structured output for the schema and other assertions to check.

Replay applies to calls routed through the runner

Your agent still executes. Model or network calls made outside the adapter remain live. Reserve stdout for JSONL messages and write diagnostic logs to stderr. For your own tools, configure tool_module and tool_registry in the suite.

Apply the pattern to your framework

These guides explain where to connect the adapter. The runnable starters above use only the Python standard library or Node.js built-in modules.

For LlamaIndex, AutoGen, CrewAI, or another stack, start with the protocol pattern and adapt the framework's tool dispatcher.