Skip to main content

retrack-ai

Retrack builds experience for AI agents.

Install retrack-ai, run your agent with the Retrack callback, and its runs become playbooks, warnings and recalls in the Retrack dashboard (sample data)

Your agent runs the same kinds of tasks every day, and starts each one from scratch. Retrack watches every run, checks whether it worked, turns what worked into playbooks and what failed into warnings, and hands the right ones to your agent before its next similar task.

This package is the connector for Retrack, a hosted service. It works with LangGraph and LangChain agents in Python.

Quickstart (5 minutes)

1. Get an API key. Sign up at retrackai.vercel.app, create a project and copy its key.

2. Install and set the key.

pip install retrack-ai
export RETRACK_API_KEY="rtk_live_..."

3. Capture every run. Add one callback to your graph:

from retrack import Retrack

rt = Retrack("support-agent")  # one name per agent

result = graph.invoke(inputs, config={"callbacks": [rt.callback()]})

Retrack records the task, each tool call and its result, the final answer, tokens and the model. Obvious secrets (API keys, tokens, passwords) are stripped on your machine before anything is sent, and the server redacts again.

4. Recall before each task.

memory = rt.recall(task)  # never raises; returns empty memory on any problem

result = graph.invoke(
    {"messages": [("system", memory.as_prompt()), ("user", task)]},
    config={"callbacks": [rt.callback()]},
)

Or as a LangGraph node: graph.add_node("memory", rt.recall_node(task_key="task")).

5. Tell Retrack what worked. Playbooks are only trusted when there's real evidence. Send a result whenever you know it, such as a passing test, a resolved ticket or a user's thumbs-up:

import uuid

run_id = uuid.uuid4()
graph.invoke(inputs, config={"callbacks": [rt.callback()], "run_id": run_id})

rt.feedback(run_id, outcome="success", source="test")  # or source="event" / "feedback"

Without a signal, Retrack's AI judge scores the run. Judged runs support playbooks, but only real signals (or your approval in the dashboard) make a playbook active.

What you get

  • Playbooks: steps that worked for a kind of task, recalled only when they clearly match (a confidence gate decides).
  • Warnings: failures your agent has hit before, with the fix that worked, if one exists.
  • Protection: tools = memory.protect(tools) adds known-fix hints to failing tools and stops your agent from repeating a failure it can't recover from.
  • Memory firewall: runs fed by untrusted input never become memory without a check or your review.
  • Proof: a small holdout group gets no memory, so the dashboard shows the measured difference memory makes.
  • Regression tests: retrack test --entry my_agent:run_task --agent support-agent replays your playbooks and known failures as tests (good in CI).
  • Model migration: retrack migrate --entry my_agent:run_task --agent support-agent --to <new-model> replays memory on a new model before you switch.

Never in your agent's way

Capture runs in the background with bounded memory and never raises into your code. Recall gives up after 1.5 seconds (rt.recall(task, timeout=...)) and returns empty memory, so your agent always runs.

Configuration

Setting Default
RETRACK_API_KEY required (without it, capture and recall are off)
RETRACK_BASE_URL https://retrack-api.vercel.app

Retrack("agent", model_id="...", tool_versions={"stripe": "2026-09"}, trusted_tools=["orders_api"]) records the model and tool versions (memory is matched to them) and marks tools whose output you trust.

Status

Early access (alpha). Requires Python 3.10+. Feedback is very welcome.

License

This connector is MIT licensed. The Retrack service it connects to is a hosted product, not open source.

Metadata

Release files for retrack-ai 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for retrack-ai 0.1.0
File Size Uploaded Provenance Actions
retrack_ai-0.1.0.tar.gz 16.1 kB Without provenance Details for retrack_ai-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for retrack-ai 0.1.0
File Interpreter ABI Platform Actions
retrack_ai-0.1.0-py3-none-any.whl Python 3 none any Details for retrack_ai-0.1.0-py3-none-any.whl

Total release size: 36.4 kB

Release files / retrack_ai-0.1.0.tar.gz

Download URL retrack_ai-0.1.0.tar.gz
Size 16.1 kB
Tags Source
SHA-256 checksum
How to use checksums
78a52ea6812b052d742b135445ee2274d0175095611e9319b597b1ea8dd1ecb9
BLAKE2b-256 checksum
How to use checksums
dc91af1ea9a4972c6e602b91e7643c1dd5f52c53d5efc42ddd9080a71e5f9c39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / retrack_ai-0.1.0-py3-none-any.whl

Download URL retrack_ai-0.1.0-py3-none-any.whl
Size 20.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f09400c8c631d4309606d458e12ccbf314af60f7af1ae8ef17fc8fd456c604fa
BLAKE2b-256 checksum
How to use checksums
a01935c6aa01bec273ab70925c8f2c21faab73d1f7b87134c8d7ed6ae3305aca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for retrack-ai 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page