Tracking: trace answers to the knowledge-base articles supplied to them

Open
#88 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
12/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
sql, typescript
Domain
analytics, backend

Research direction

This is a tracking issue for a multi-issue series, so start from a child issue, not this one; #429 is the first to pick up. Read countArticleUsage and the kb_article_usage table to see how supplied-context counts are written today, and content/docs/product/knowledge-base.mdx, which every child issue must update. Done means the child issue's acceptance points and regression tests pass, with the existing count labeled "Supplied as context".

Written by the indexing model from the issue text.

Description

backend enhancement frontend help wanted

Copied from DeadantCo/answerLoops#78 · originally opened by sethr07 on 2026-11-20

Copied from https://github.com/answerLoops/answerLoops/issues/422 — originally opened by @NathanTarbert on 2026-10-21

Tracking issue. The work is split into the issues below, in the order they should land.

Problem

Teams need to trace a generated answer to the knowledge-base articles supplied to it, and tell context exposure apart from evidence that an article contributed to the answer.

countArticleUsage receives article ids from the supplied context without looking at the answer, and adds one to a per-article, per-day count in kb_article_usage. If A, B and C are supplied but the reply reflects only A, all three get a count. The metric describes context exposure, not contribution, quality or delivery. It also is not displayed anywhere in the dashboard today (a pull request, #441, is in progress to show it for #429), and there is no answer-to-article history.

How the series fits together

  • Answer sources (#429 to #432) are facts only: what was supplied to each answer, in what rank, and at which revision. No judgment about the answer.
  • The separate source-support series is tracked in #437 and builds on these records.
  • Article freshness is tracked separately in #453.
  • Article history is tracked in #423.

Plan

  • Show the existing count in the dashboard, labeled "Supplied as context": #429
  • Answer-references storage, with written retention and access decisions: #430
  • Record references from the widget, Discord, Agent API and ticket paths: #431
  • Inspect an answer's sources and an article's recent answers: #432

The storage issue reuses the content-hash revision helper added in the article event log issue under #423, so land that first.

Principles every issue follows

  • Historical counts keep their meaning: "supplied as context".
  • Searches and simulations stay separate from production usage.
  • Retries and repeated completion callbacks never double-count an answer, and duplicate passages count once per article per answer.
  • Editing, re-syncing or deleting an article never silently rewrites what an existing trace represents.
  • No question text, answer text or visitor identity is stored with references.
  • Unassessed means unassessed, never "unused". Contribution claims always show their method and evidence, and ambiguous results stay inconclusive.
  • Each issue updates content/docs/product/knowledge-base.mdx and adds regression tests.

Related: #423 covers who added and verified an article. Freshness policy, such as product-version stamps and downweighting outdated articles, is a separate design: an old article may be correct, and a frequently supplied one may be outdated.

Start here: new to the project? Read CONTRIBUTING.md first. It covers the ground rules, running answerLoops locally, and how to open a pull request.

Dominant language
TypeScript
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DeadantCo/answerLoopsdev

All issues in DeadantCo/answerLoopsdev

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.