Skip to main content

Context analytics

Project description

ctxrot

Understand your ReAct agent's context window and fight context rot.

Note: ctxrot currently supports only DSPy>=3.1.3 and may produce mis-aligned output. Please report any issues you encounter — the API may change.

Install

uv add ctxrot

Quick start

import dspy
from ctxrot import CtxRotCallback

callback = CtxRotCallback(db_path="ctxrot.db", store_content=True)

dspy.configure(
    lm=dspy.LM("openai/gpt-5.4-mini"),
    callbacks=[callback],
)

react = dspy.ReAct("question -> answer", tools=[tool_a, tool_b])
result = react(question="What is the capital of France?")

Then open the TUI dashboard:

ctxrot --db ctxrot.db

Learn more

Documentation

The site also publishes an llms.txt / llms-full.txt for LLM agents that want to ingest the docs directly.

License

MIT

Project details


Download files

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

Source Distribution

ctxrot-0.1.2.tar.gz (216.8 kB view details)

Uploaded Source

Built Distribution

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

ctxrot-0.1.2-py3-none-any.whl (45.0 kB view details)

Uploaded Python 3

File details

Details for the file ctxrot-0.1.2.tar.gz.

File metadata

  • Download URL: ctxrot-0.1.2.tar.gz
  • Upload date:
  • Size: 216.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ctxrot-0.1.2.tar.gz
Algorithm Hash digest
SHA256 aec1aa60558d642f57fd26f2f88bd4884bf918ef36510372dcee50582ea5f14f
MD5 340eb8a70b3dd7e0f8e0a85937746576
BLAKE2b-256 d7af1e5e546c9497b5a757a9cd84b92baad0e3756bbaa428c6909ac71ed1afde

See more details on using hashes here.

File details

Details for the file ctxrot-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: ctxrot-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 45.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ctxrot-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c7fa832a035ddf74668313526dd9a5f75c75a2a4ba220c1b0de41d6d8c4325f3
MD5 49397eabf1027c99f5bd0bd901f8e9bd
BLAKE2b-256 7dae8df5e3723a6408f81519abab1bb71c4c2e90398f8295865ad30972bbfea5

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