Skip to main content

redlineai-sdk

Run your own agent inside a Redline experiment — from your repository, on your machine, against the same tasks and rubrics as the agents in the catalog.

Your agent does not move. It stays where it is, keeps its own dependencies and its own model keys, and Redline sends it work.

Install

pip install redlineai-sdk
redline init

init writes agents.py — one file, holding one TODO.

Wrap what you already wrote

from redline import agent
from myapp.agent import your_agent      # ← your existing code, unchanged


@agent(id="my-agent", name="My Agent", description="Describe what it is good at.")
def run(task, ctx):
    ctx.thinking("Working out what the task needs…")
    return your_agent(task.prompt)      # ← the one line that is yours

Then:

export REDLINE_API_KEY=rl_…            # Agents page → Connect your agent
redline dev

That registers the agent with your project and holds a connection open. It now appears on the Agents page, can be selected in an experiment, and runs on your machine when one is launched.

There is no endpoint to expose and nothing deployed to us — redline dev connects outbound and pulls its work, so it runs from a laptop behind NAT.

Telemetry you do not have to write

pip install "redlineai-sdk[otel]"

Any framework that speaks OpenTelemetry — Pydantic AI, LangChain's instrumentation, anything on the global tracer — has its LLM and tool spans land in the run's transcript by itself. ctx.thinking(...) is there for what the spans do not say.

What an experiment gives your agent

An experiment can attach MCP servers, skills, CLIs and repositories. Those arrive as real tools, not as prose in the prompt:

pip install "redlineai-sdk[mcp]"
import asyncio
from redline import agent, redline_tools


@agent(id="my-agent", name="My Agent")
def run(task, ctx):
    attached = asyncio.run(redline_tools(task))   # MCP tools + machine_run
    return your_agent(task.prompt, tools=attached.as_openai_schema())

AttachedTools also hands them over ready-shaped: for_pydantic_ai() returns Pydantic AI Tools, for_langchain() returns StructuredTools.

If your agent uses Pydantic AI or LangChain, you can skip even that. redline dev patches pydantic_ai.Agent, langgraph.prebuilt.create_react_agent and langchain.agents.create_tool_calling_agent as they are constructed, so the experiment's tools are already on your agent without a line of yours changing.

The machine

machine_run is there in every run — not only the ones that attached something. Your agent runs on your laptop; this is a shell on the project's Linux machine, in a directory of the run's own. Attach a repository and it is already cloned there; attach nothing and you still have a computer, which is what an agent needs the moment a task says "write a file".

attached = asyncio.run(redline_tools(task))
# → machine_run, plus a tool per attached MCP server

The machine starts when you first call the tool and never before, so a run that does not use it costs nothing.

Your repo's environment

redline dev is a second entry point into your app, and your real one almost always loads a .env first — so this one does too, searching the root and one level down. Shell variables always win. REDLINE_ENV_FILES=server/.env takes exact control.

Commands

redline init write a starter agents.py
redline dev register your agents and take work
REDLINE_API_KEY runner key, rl_…, from the Agents page
REDLINE_URL your Redline; defaults to http://localhost:8790

Where agents are found

agents.py, or every *.py in an agents/ folder. Not redline.py — a file by that name in your working directory shadows this package on sys.path, and the import error it produces blames the wrong thing entirely.

Names

install pip install redlineai-sdk
import from redline import agent
npm @redlineai/sdk

The npm package is scoped and PyPI has no scopes, so @redlineai/sdk cannot exist here — redlineai-sdk is the same name with the slash flattened. The import stays redline, which is what you type a hundred times more often than the install line.

pip install redline-sdk also works; it is a shim that installs this.

Docs

https://tryredlineai.co/docs/agents/your-agent

MIT.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

redlineai_sdk-0.2.3.tar.gz (21.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

redlineai_sdk-0.2.3-py3-none-any.whl (23.4 kB view details)

Uploaded Python 3

File details

Details for the file redlineai_sdk-0.2.3.tar.gz.

File metadata

  • Download URL: redlineai_sdk-0.2.3.tar.gz
  • Upload date:
  • Size: 21.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for redlineai_sdk-0.2.3.tar.gz
Algorithm Hash digest
SHA256 e07d2398be34391bc49b32cff877c9d50b970c7e045ecc6be99fc803cdaff021
MD5 1a600dbac9ebeac98e39ff1fc5d6d395
BLAKE2b-256 2db53c5e65d4729d13e58acbfe93646bec51e72f5025dbb904c0b62a11f712aa

See more details on using hashes here.

File details

Details for the file redlineai_sdk-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: redlineai_sdk-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 23.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for redlineai_sdk-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5a8718decb61f5a6bfbd143c2529f8bb2e4dca9a0c3af261db8cac04bde1922c
MD5 770f1b975fb5cd13eace81c1098f95a3
BLAKE2b-256 673f2328cff0033d5ac6070fa7ea74f30b7f5d630a33e3063a83cc82e2a43309

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page