Skip to main content

ExperimentLane

An evidence-driven experimentation engine for AI agents. Record experiments, compare them against baselines, and get a deterministic decision about what to change next — one variable at a time.

The Python package mirrors the TypeScript implementation (@talocode/experimentlane) 1:1.

What is it

ExperimentLane tracks content and agent experiments as receipts: a baseline, a run, and the platform-exposed metrics that come back. It compares them, names a winner, picks the strongest and weakest signals, and tells the agent exactly what to change next while everything else stays constant.

Why it exists

Most agents ship a variation, see a number, and guess. That is how B-tests quietly become A/B/C/D tests and nothing is ever attributable.

ExperimentLane encodes the discipline most agents are missing: change exactly one independent variable at a time. It is a local, deterministic, no-frills engine any agent can embed, so experiments stay honest, small, and comparable.

Open engine first. The hosted power can come later — the same schema is shaped for the Talocode API surface.

Install

pip install talocode-experimentlane

Python 3.8+, no runtime dependencies.

Quickstart

from talocode_experimentlane import ExperimentLane, JsonStore

lane = ExperimentLane(JsonStore(".experimentlane"))
lane.init()

# 1. Define a lane for a platform's exposed metrics
shorts = lane.create_lane(name="youtube-shorts", platform="youtube_short")

# 2. Record a baseline (the control asset's platform-exposed metrics)
base = lane.create_baseline(
    lane_id=shorts["id"],
    metrics={"views": 480, "avg_view_percent": 75, "shares": 10, "subscribers": 2},
)

# 3. Create the experiment — exactly one variable changes
asset = lane.create_asset(lane_id=shorts["id"], title="reliability-short-2")
exp = lane.create_experiment(
    lane_id=shorts["id"], asset_id=asset["id"], baseline_id=base["id"], variable="hook"
)

# 4. Record the receipt after the run
lane.add_receipt(
    experiment_id=exp["id"],
    metrics={"views": 624, "avg_view_percent": 87, "shares": 14, "subscribers": 3},
)

# 5. Compare and get one deterministic decision
result = lane.compare(experiment_id=exp["id"])
print(result["comparison"]["winner"])      # "experiment"
print(result["decision"]["line"]["nextExperiment"])  # "change only <weakest signal>"
print(result["decision"]["line"]["everythingElse"])  # "hold constant"

Canonical import: from talocode_experimentlane import ExperimentLane, JsonStore.

Auth / env

The local store needs no API key. Optional environment variable:

  • EXPERIMENTLANE_DIR — override the default data directory (default .experimentlane).

API surface

Everything is comparable-metrics only — absent metrics are "unavailable", never a failure.

Method Purpose
create_lane Define a platform and its metric priority
create_asset A piece of content or an agent run
create_baseline The control — an asset snapshot or explicit metrics
create_experiment An assignment changing exactly one variable
add_receipt The platform-exposed metrics that came back
compare Computes deltas, names winner, picks strongest/weakest signals
next Recommends the next single variable to change
validate_next Guardrail: reject proposals that change 2+ variables
history Full audit trail per experiment
lineage_of The reuse lineage of an asset back to its primary proof

Platform schemas

Platforms (youtube_short, tiktok, instagram_reel, x_post, generic) map their exposed metrics. shares_per_view is derived from views + shares when both are present. A receipt may only contain metrics listed for its lane platform — unknown keys raise a clear error.

Guardrail codes

Code Meaning
EXPERIMENT_OK Exactly one independent variable changed
EXPERIMENT_INVALID 2+ independent variables changed — reject

CLI

experimentlane lane create --name my-shorts --platform youtube_short
experimentlane receipt add --experiment <id> --views 624 --shares 14
experimentlane compare --experiment <id>
experimentlane next --experiment <id> --propose hook,duration   # guardrail check

Data lives in .experimentlane (override with EXPERIMENTLANE_DIR).

Related packages

Sibling installs for the Talocode ecosystem:

Package Install
StackLane pip install talocode
Tera pip install talocode-tera
Codra pip install talocode-codra
DocuLane pip install talocode-doculane
XSearchLane npm i @talocode/xsearchlane

Talocode ecosystem

Product Description
ExperimentLane (this package) — evidence-driven experiment engine for agents
Tera Capability API under Talocode Cloud
Codra Coding agent / skills runtime
StackLane Cloud backend: projects, API keys, credits, billing
SearchLane Search API product
GateLane Policy gates
ContextLane Context management
ScreenLane Screen capture pipeline
MemoryLane Agent memory
Tradia Trading agents
DevTool Developer tooling
XProLane X advanced tools
XSearchLane X realtime search
Agent Browser Browser control
InvoiceLane Invoicing
GeoLane Geolocation
ClipLoop Clip builder
DocuLane Office document tools for agents

More: github.com/talocode · talocode.site · docs.talocode.site

License

MIT © Talocode.

Download files

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

Source Distribution

talocode_experimentlane-0.1.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

talocode_experimentlane-0.1.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file talocode_experimentlane-0.1.0.tar.gz.

File metadata

  • Download URL: talocode_experimentlane-0.1.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for talocode_experimentlane-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dbd8a02e9bcf10e219eabb8b2d4560a1bfee6bd5eec67520d68f736003cc4bee
MD5 8127495ffee9ad62c896bc832e8bd8fa
BLAKE2b-256 812777d79ef9ffc0ee69da2f3af2be10dd5a6cd64701c52b432c710aeec4df45

See more details on using hashes here.

File details

Details for the file talocode_experimentlane-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for talocode_experimentlane-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f1a5412573ba53a8f17f2173834a180cd07a39dc746d7c85bd762b50a8ea03a6
MD5 4063a1f2e89933b7ea19324fd7f56427
BLAKE2b-256 19b91811bd61d2ee1d576e6be86351520c9c963ea92a7c817733b2f8a83ed0f2

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 Pingdom Monitoring Sentry Error logging StatusPage Status page