Python toolkit, MCP server, and agent skills for reproducible, auditable clickstream and event log analytics. Helps AI agents, data scientists and analysts build, validate, and cross-check product analytics, quantitative UX, customer journeys, graph-based user flows, behavioral segmentation, A/B tests, process mining models, Markov chain simulation
# Add to your Claude Code skills
git clone https://github.com/retentioneering/retentioneering-toolsGuides for using ai agents skills like retentioneering-tools.
retentioneering-tools is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by retentioneering. Python toolkit, MCP server, and agent skills for reproducible, auditable clickstream and event log analytics. Helps AI agents, data scientists and analysts build, validate, and cross-check product analytics, quantitative UX, customer journeys, graph-based user flows, behavioral segmentation, A/B tests, process mining models, Markov chain simulation. It has 949 GitHub stars.
retentioneering-tools's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/retentioneering/retentioneering-tools" and add it to your Claude Code skills directory (see the Installation section above).
retentioneering-tools is primarily written in Python. It is open-source under retentioneering on GitHub, so you can review or fork the full source.
Yes. AgentsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh retentioneering-tools against similar tools.
No comments yet. Be the first to share your thoughts!
Unlocks once the catalog security scan passes (runs nightly).
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
Retentioneering is an open-source Python library for understanding user behavior from event logs. Find where users get stuck, compare the paths different groups take, and discover patterns across clicks, sessions and repeat visits. Explore the data yourself or let an AI agent work with the same tools.
Run a demo notebook in Google Colab – no need to install the library locally, sample data included.
Quick start · Use cases · Use an AI agent · Docs
A demo of the interactive features of the transition graph widget. You can highlight a route, compare path groups, focus on the step you want to investigate, and explore incoming and outgoing transition probabilities in the ego view.
Use Retentioneering when you have a question about the sequence of actions like these:
Bring an event-level export from your analytics platform, warehouse or application logs. All you need is a user, session or case ID; an event name; and a timestamp.
Python: 3.11 - 3.13.
Environment: Jupyter (Jupyter Notebook, JupyterLab, JupyterLab Desktop), VS Code, Cursor, Google Colab.
To install the library, run
pip install retentioneering
Within a notebook, use %pip install retentioneering instead. See the installation guide for the details.
To try out the library quickly, without loading your own data, you can use a built-in e-commerce dataset:
import retentioneering as rete
stream = rete.datasets.load_ecom() # bundled synthetic store
stream.transition_graph()
Below are a few examples of how you can apply retentioneering tools to approach common analytical problems on the bundled e-commerce demo dataset. The code chunks assume stream = rete.datasets.load_ecom().
Create a binary segment that cuts each path at the boundaries of the affected period: its events inside the period are labelled inside, the rest outside, so one path can contribute to both parts. Then compare user behavior across these parts with the transition graph widget.
periods = stream.add_segment("period", time_range=("2024-05-19", "2024-06-07"))
periods.transition_graph(diff=("period", "inside", "outside"))
Click a node (e.g. payment_details) to inspect the routes that pass this node. With this comparison configuration, red means a higher next-step probability inside the period; blue means lower. This locates a behavioral difference to investigate.
Letting a path contribute to multiple levels of a segment gives more flexibility to diff mode: you can compare not only common attributes like mobile vs. desktop, acquisition channels, or experiment groups, but dynamic features as well: first session vs. the others, weekends vs. weekdays, etc.
Count sessions that complete the steps in order – rather than whole user journeys (path_col="session_id") – with the funnel widget:
steps = ["cart", "shipping_details", "purchase"]
stream.funnel(steps=steps, path_col="session_id")
Then compare sessions that stopped at the shipping stage of this funnel with those that completed it using the step matrix widget in diff mode:
(
stream
.add_segment("stage", funnel_events=steps, path_col="session_id")
.step_matrix(
path_pattern="cart->.*->shipping_details",
step_window=2, path_col="session_id",
diff=("stage", "shipping_details", "purchase"),
)
)
The path_pattern="cart->.*->shipping_details" argument of the step matrix breaks down the diagram into two parts: around cart and around shipping_details. You can inspect these surroundings and compare sessions that reached shipping_details but not purchase with those that completed the funnel.
Instead of using traditional tree-like diagrams for path exploration, you can use Step Sankey, which shows the same numbers as a Step Matrix, drawn as flows. In this example, we align all the paths by the payment_error event and display the two steps on either side of it:
stream.step_sankey(
anchor="payment_error", step_window=2,
path_col="session_id",
)
A plain event name anchors each path on its first occurrence. An anchor spec chooses the position more precisely: which occurrence to use, which event of a pattern to center on (at), or how far to shift from it (offset). For example, align sessions on their last payment error to see whether users recover after it or give up:
stream.step_sankey(
anchor={"pattern": "payment_error", "occurrence": "last"},
step_window=2, path_col="session_id",
)
After the last error, sessions end more often than after the first one: two steps later, path_end takes 41% instead of 32%. Either way, the next step is almost always support_chat (89%).
Find sessions that opened the cart, then ended without reaching shipping or support:
abandoned = stream.filter_paths(
{"metric": "matches_pattern", "op": "=", "value": True,
"metric_args": {
"pattern": "cart->[^shipping_details|support_