
The problem
A graph database answers what is connected. The questions a sales team actually asks are about what is probably true: will this deal close, what kind of company is this, which fact about the account matters.
The useful evidence often sits one link away. Whether we know the CTO lives on the account, not on the deal, so a model trained on the deals table never sees it unless someone joins and flattens the data first, and keeps that pipeline in step with every new contact.
How it works
Contacts and deals link to their company. A dotted path such as company_id.industry reads a link forward; $refs.contacts.company_id reads it backwards, from the company to its people. Put either in the where of a query with a predict, and the linked facts become evidence for the prediction, with $why naming which ones moved it.
The same shape classifies a node from its neighbours: predict a company's industry from whether a CFO works there. Forward paths chain as deep as the schema goes. What is not part of this is traversal of unknown length, such as reachability or shortest paths, and graph algorithms; for those, use a graph database.
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.
Add prediction over a knowledge graph to this codebase using Aito, a predictive database. The feature: predict facts about our accounts and deals from the records linked to them (contacts, other deals), reading the links both ways, with the reasons naming the evidence. 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/knowledge-graph-prediction/ 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/graph.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. 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.
Frequently asked
Is this a graph database?
No. Aito reads links forward, to any depth your schema has, and backwards with $refs, and predicts over them. It does not search for paths of unknown length, such as reachability or shortest paths, and it has no graph algorithms such as PageRank. What it adds is the part a graph database lacks: a calibrated prediction over the links, with the evidence behind it.



