Metadata-Version: 2.5
Name: onrecord
Version: 0.1.0
Summary: Voice-of-customer insights where every quote is checked, word for word, against its source.
Project-URL: Homepage, https://github.com/harryjaxx/onrecord
Author: Harry Otuechere
License-Expression: MIT
License-File: LICENSE
Keywords: agent-skills,hallucination,llm,marketing,mcp,quotes,voice-of-customer
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Text Processing :: Linguistic
Requires-Python: >=3.10
Requires-Dist: pyyaml>=6.0
Provides-Extra: dev
Requires-Dist: coverage>=7.5; extra == 'dev'
Requires-Dist: hypothesis>=6.100; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Provides-Extra: mcp
Requires-Dist: mcp<3,>=2.0; extra == 'mcp'
Description-Content-Type: text/markdown

<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/harryjaxx/onrecord/main/docs/assets/header-dark.svg">
  <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/harryjaxx/onrecord/main/docs/assets/header-light.svg">
  <img src="https://raw.githubusercontent.com/harryjaxx/onrecord/main/docs/assets/header-light.svg" width="100%" alt="onrecord: customer insights where every quote is checked against its source">
</picture>

<p>
  <a href="https://github.com/harryjaxx/onrecord/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/harryjaxx/onrecord/actions/workflows/ci.yml/badge.svg"></a>
  <img alt="Python 3.10+" src="https://img.shields.io/badge/python-3.10%2B-7C5CFF?style=flat-square">
  <img alt="MIT licence" src="https://img.shields.io/badge/licence-MIT-22D3EE?style=flat-square">
  <img alt="Agent Skill + MCP" src="https://img.shields.io/badge/agent%20skill-%2B%20MCP-24292f?style=flat-square">
</p>

**Turn sales calls, reviews and interviews into a voice-of-customer report where every quote is checked, word for word, against its source.**

AI is very good at pulling objections and pain points out of transcripts. It is also very good at inventing quotes that sound exactly like your customers. `onrecord` lets your AI agent do the reading and makes sure nothing it quotes was made up.

## Before and after

| Without onrecord | With onrecord |
|---|---|
| Someone reads 40 call transcripts, copies the best lines into a doc and hopes they copied them right. It takes days, and nobody re-checks. | Your AI agent extracts insights from all 40 in minutes. Every quote is checked against the transcript it came from, and any it cannot find is dropped. |
| An AI summary says a customer "loved the onboarding". Did they actually say that? | Every quote in the report names its source and timestamp. Rejected quotes are listed next to the closest thing the customer really said. |

In production on a sales-call pipeline at a UK manufacturing company, the check caught 10 of 59 AI-extracted quotes (17%) as invented.

## Demo

The bundled sample is a set of invented sales calls and reviews for a fictional SaaS product, in English, German and Japanese. Eight fake quotes are hidden in the AI extracts: a swapped word, an invented clause, two lines stitched together from opposite ends of a call, an out-of-order quote, a dropped umlaut, one changed Japanese character, a plausible paraphrase, and a quote that starts halfway through a word.

```bash
pip install onrecord
onrecord demo
```
<!-- demo:start -->
```text
VOICE OF CUSTOMER · 32 sources · 74 quotes checked
✔ 64 verified   ✘ 8 rejected (11%)   · 2 too short
```
<!-- demo:end -->

All eight fakes are caught; every real quote passes.

<img src="docs/assets/demo.svg" width="100%" alt="Terminal output of onrecord demo: the headline, the top objection with verified quotes, and rejected quotes shown beside the closest real passage">

## Install

### Claude Code

```text
/plugin marketplace add harryjaxx/onrecord
/plugin install onrecord@onrecord
```

On Claude Code 2.1.275 or later this is one step: `/plugin install onrecord --marketplace harryjaxx/onrecord`. The skill calls the `onrecord` command, so also run `pip install onrecord`.

Then ask Claude something like *"Use onrecord to pull the objections out of the calls in ./transcripts."*

### OpenAI Codex

```bash
git clone https://github.com/harryjaxx/onrecord
mkdir -p ~/.agents/skills && cp -r onrecord/skills/onrecord ~/.agents/skills/
pip install onrecord
```

### MCP: ChatGPT, Claude Desktop, Cursor and other MCP apps

```bash
pip install "onrecord[mcp]"
claude mcp add --transport stdio onrecord -- onrecord-mcp     # Claude Code
codex mcp add onrecord -- onrecord-mcp                        # Codex
```

The server exposes three tools: `check_quotes`, `build_report` and `list_categories`. For apps that only connect to remote servers, such as ChatGPT, run `onrecord-mcp --http` (it serves `http://127.0.0.1:8000/mcp`), put it behind HTTPS, and add that URL as a connector. In HTTP mode the tools take text only and never read the server's disk. There is no hosted instance: you run the server, so your transcripts stay with you.

### Python

```python
from onrecord.match import verify

verify("we were quoted almost triple by the other lot",
       "Honestly, we were quoted almost double by the other lot.")
# QuoteResult(status='rejected', spans=(), reason='not found in source',
#             closest='we were quoted almost double by the other lot', similarity=0.911)
```

## How it works

1. **Your agent extracts.** Following [the skill](skills/onrecord/SKILL.md), it writes one JSON file per source: each insight has a category (objection, pain point, buying reason, competitor mention, feature request), a one-line summary in its own words, a theme, and a quote copied verbatim.
2. **`onrecord check` verifies.** No AI is involved in checking. Text is normalised for any language (case, punctuation and Unicode forms), the quote is split at `…` and `[bracketed]` corrections are set aside, and every piece must appear in the source in order, close together, and on whole-word boundaries.
3. **`onrecord report` builds the report** from verified quotes only, ranks themes by how many separate sources mention them, and lists rejected quotes beside the closest real passage.

| Rule | Default | Flag |
|---|---|---|
| Minimum quote length | 4 words, or 10 characters in Chinese, Japanese and Thai | `--min-words`, `--min-chars` |
| Maximum gap between `…`-joined pieces | 400 characters | `--max-gap` |
| Accents must match (`für` ≠ `fur`) | on | `--fold-accents` to relax |
| Currency, percent and +/− signs must match (`£50` ≠ `$50`) | on | |
| Longest `[bracketed]` correction | 5 words | |
| Closest passage shown when similarity is at least | 0.6 | |

Inputs: `.txt`, `.md`, `.vtt` and `.srt` transcripts, and `.csv` review exports (one row per review, `id` and `text` columns; Excel's Windows-1252 exports are read correctly).

```text
onrecord check SOURCES EXTRACTS [--out results.json] [--strict] [--max-rejection-rate 0.05]
onrecord report SOURCES EXTRACTS [--out report.md] [--json report.json]
onrecord schema   # the extract JSON Schema
onrecord demo
```

`onrecord check` exits 0 when every quote is verified, 1 when any is rejected, and 2 on unreadable input, so it can gate a pipeline or CI job. The full reasoning is in the [design note](docs/design.md).

## Limits

- "Verified" means the words appear verbatim and in order in the source. It does not prove the meaning survived the edit: a quote that skips a "not" with `…` can still pass. The summary in `insight` is the agent's own words and is not checked.
- `[Bracketed]` corrections are trusted and not checked, so they are capped at 5 words. A short bracket can still change the sense of a quote.
- Quotes too short to prove anything ("yes, definitely") are reported as too short, not as verified.
- Text only. Transcribe audio first, for example with Whisper.

## Licence

MIT © 2026 Harry Otuechere
