Wrap the code that makes a decision and Recount records each step: the data it fetched, the rules it checked, what the model said. Your logic stays as it is, and people outside engineering can read the result.
import recount from '@refactorlabs/recount';
await recount.startTrace('Home insurance quote', async () => {
const res = await recount.fetch('Property data', propertyUrl);
const property = await res.json();
const risk = scoreRiskFactors(property);
recount.addSpan('json', 'Risk factors', { output: risk });
if (risk.floodZone === 'HIGH') {
recount.addAlert('Elevated flood risk', 'warn', {
checks: [{ target: 'Flood loading', value: risk.floodLoading }]
});
}
const quote = buildQuote(risk);
recount.addSpan('json', 'Final quote', { output: quote });
return quote;
});import recount
async def home_insurance_quote():
res = await recount.fetch("Property data", property_url)
property_data = res.json()
risk = score_risk_factors(property_data)
recount.add_span("json", "Risk factors", {"output": risk})
if risk["flood_zone"] == "HIGH":
recount.add_alert("Elevated flood risk", "warn", {
"checks": [{"target": "Flood loading", "value": risk["flood_loading"]}]
})
quote = build_quote(risk)
recount.add_span("json", "Final quote", {"output": quote})
return quote
await recount.start_trace("Home insurance quote", home_insurance_quote)A table shows as a table and a request as a request, so a support agent can follow a trace as easily as you can.
Outbound requests, with credentials redacted.
SQL or NoSQL queries and what they returned.
Rows of data, with highlights and summary rows.
Line, bar, pie or scatter charts.
Any structured value, like a quote or a score.
Plain text, as info, a warning or an error.
A model call: its prompt, model and response.
An image shown inline, like a scanned document.
A collapsible section of related steps.
Use the SDK’s wrappers and each call becomes a step, timed, with its input and output.
recount.fetch()recount.fetch()wrapCollection()wrap_collection()wrapAnthropic()wrap_anthropic()wrapOpenAI()wrap_openai()Flag a step as a warning or error with the values behind it, and it shows up everywhere that decision does.
Put two decisions side by side to see exactly where they went different ways.
Connect an AI assistant that supports MCP and ask why a quote, price or decision came out the way it did. It reads the trace and explains it in plain English. Access is read-only, so it can never change your data.
Each takes you from install to your first trace in the dashboard.
Usually a few lines. Install the Node.js or Python SDK, wrap the code behind a decision and add a step for each part that matters. The SDK’s wrappers record HTTP requests, MongoDB queries and Anthropic and OpenAI calls for you. Most teams start with one decision, such as quotes or claims, and add more from there.
Node.js (npm install @refactorlabs/recount) and Python (pip install recount-sdk). Both have the same concepts: traces, spans, groups and alerts.
Yes, on the Pro plan. Connect an AI assistant that supports MCP and it can search traces, open one and read daily summaries, then explain a decision in plain English. Its access is read-only.
Free to start. No credit card required.