Decision tracing for Node.js and Python.

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.

Get started free
quote.ts
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;
});

Nine kinds of step, each drawn the way a person reads it.

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.

  • HTTP

    Outbound requests, with credentials redacted.

  • Database

    SQL or NoSQL queries and what they returned.

  • Table

    Rows of data, with highlights and summary rows.

  • Chart

    Line, bar, pie or scatter charts.

  • JSON

    Any structured value, like a quote or a score.

  • Message

    Plain text, as info, a warning or an error.

  • LLM

    A model call: its prompt, model and response.

  • Image

    An image shown inline, like a scanned document.

  • Group

    A collapsible section of related steps.

Recorded for you.

Use the SDK’s wrappers and each call becomes a step, timed, with its input and output.

  • HTTP
    recount.fetch()
    Records the request and response.
  • MongoDB
    wrapCollection()
    Records each query and its results.
  • Anthropic
    wrapAnthropic()
    Records every prompt, response and token count.
  • OpenAI
    wrapOpenAI()
    Records every prompt, response and token count.
  • Alerts on any step

    Flag a step as a warning or error with the values behind it, and it shows up everywhere that decision does.

  • Compare any two runs

    Put two decisions side by side to see exactly where they went different ways.

Or just ask.

Pro

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.

  • search_traces
  • get_trace
  • get_daily_summary
  • list_projects
  • list_environments
AI assistantRecount connected
Why did quote QT-20840 come out at $4,200? The customer says that's high for a brick house.
Two loadings drove it up: the property is in a high flood zone (+18%) and was built in 1985 (+12%). Brick construction (−5%) only partly offset them, and every eligible discount was applied.

Start with the guide for your language.

Each takes you from install to your first trace in the dashboard.

Questions, answered.

How much work is it to add Recount?

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.

Which languages are supported?

Node.js (npm install @refactorlabs/recount) and Python (pip install recount-sdk). Both have the same concepts: traces, spans, groups and alerts.

Can an AI assistant read our traces?

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.

Your software already makes the decisions.Now it can explain them.

Free to start. No credit card required.