Pipeline Close Likelihood

Every open deal carries a probability of closing, learned from the deals that closed before and shown beside the rep's own typed-in probability, so the deals where the two disagree stand out.

Pipeline Close Likelihood: screenshot from the Company AI demo
_predict_queryCross-vertical
In the demoOn Company AI's synthetic pipeline, the same deal profile reads 58% to close with a champion and 30% without one, learned from the deals that closed before rather than set by hand. Stage is left out on purpose: all five open stages read the same number, because no closed deal carries an open stage.

The problem

Pipeline value is usually the optimistic sum of everything open, or a sum weighted by a stage percentage someone typed into the CRM years ago. Neither reflects what actually happened to deals like these.

How it works

_predict of won for each open deal, conditioned on what is known before the outcome (blocker, whether there is a champion, the account's segment), with $why for the factors. The rep's own probability stays beside it; where the two diverge is the deal to look at.

Stage is deliberately not evidence. A closed deal's stage is closed_won or closed_lost, so the history holds nothing about how a pilot converts, and conditioning on it would only look like conditioning. Stage-aware odds need the stage each deal closed from.

For the full architecture, see the technology overview. For the broader narrative across multiple use cases, read The Predictive Application.

See it live

This use case runs in Company AI, a reference application you run yourself. There is no hosted demo, so the link opens its illustrated tour and source on GitHub: Company AI tour on GitHub →

Build it with Claude Code

Paste this prompt into Claude Code, or another coding agent, in your own codebase. It runs Aito locally from the Docker image, reads the API docs written for agents, and follows a working reference implementation.

Pipeline close likelihood: a prompt for Claude Code
Add pipeline close likelihood to this codebase using Aito, a predictive database. The feature: predict the probability of closing for each open deal in our CRM from the deals that closed before, with the reasons, and show it beside the rep's own probability.

1. Run Aito locally: `docker pull ghcr.io/aitohq/aito`, then follow https://aito.ai/docker/ to start it with your own API keys (keep them in the environment, never in code).
2. Read https://aito.ai/docs/api/llms.txt for the v2 query shapes before writing any query.
3. Read the use-case guide: https://aito.ai/use-cases/pipeline-close-likelihood/
4. Use this reference implementation as the pattern (schema, data load and queries): https://github.com/AitoDotAI/aito-company-ai/blob/main/src/company_ai/deals.py and https://github.com/AitoDotAI/aito-company-ai/blob/main/src/company_ai/schema.py
5. Find the matching tables in this codebase, design the Aito schema for them (links between tables where we have foreign keys), and load a sample.
6. Measure before wiring the UI: hold out recent closed rows and report the calibration per probability band against the base rate, and against the rep's own probability.
7. In the UI, show the probability ($p) and the reasons ($why) on each row, and flag the rows beyond a threshold I choose for review. Never write the score back as a decision.

Ask me before changing anything outside the new feature.