Metadata-Version: 2.4
Name: ctxrot
Version: 0.1.1
Summary: Context analytics
Project-URL: Homepage, https://github.com/williambrach/ctxrot
Project-URL: Repository, https://github.com/williambrach/ctxrot
Project-URL: Issues, https://github.com/williambrach/ctxrot/issues
Author-email: William Brach <wibrach@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: analytics,context-rot,context-window,dspy,llm,token-usage
Classifier: Development Status :: 3 - Alpha
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.12
Requires-Dist: dspy>=3.1.3
Requires-Dist: litellm>=1.82.6
Requires-Dist: opentraces>=0.3.3
Requires-Dist: rapidfuzz>=3.14.3
Requires-Dist: textual-plotext>=1.0.1
Requires-Dist: textual>=8.1.1
Requires-Dist: tokie>=0.0.7
Requires-Dist: typer>=0.24.1
Provides-Extra: dev
Requires-Dist: black>=26.3.1; extra == 'dev'
Requires-Dist: ruff>=0.15.7; extra == 'dev'
Requires-Dist: ty>=0.0.25; extra == 'dev'
Provides-Extra: docs
Requires-Dist: black>=26.3.1; extra == 'docs'
Requires-Dist: mkdocs-llmstxt-md>=0.1; extra == 'docs'
Requires-Dist: mkdocs-material>=9.7.6; extra == 'docs'
Requires-Dist: mkdocstrings[python]>=0.27; extra == 'docs'
Description-Content-Type: text/markdown

# ctxrot

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


> **Note:** ctxrot currently supports only [DSPy>=3.1.3](https://dspy.ai) and may produce mis-aligned output. Please [report any issues](https://github.com/williambrach/ctxrot/issues) you encounter — the API may change.

## Install

```bash
uv add ctxrot
```

## Quick start

```python
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:

```bash
ctxrot --db ctxrot.db
```

## Learn more

Full [Documentation →](https://williambrach.github.io/ctxrot/) — concepts, CLI reference, Python API, export formats, deep analysis, and runnable examples.

The site also publishes an [`llms.txt`](https://williambrach.github.io/ctxrot/llms.txt) / [`llms-full.txt`](https://williambrach.github.io/ctxrot/llms-full.txt) for LLM agents that want to ingest the docs directly.

## License

MIT
