Recall: turn saved material into a library you can question and check
Recall keeps articles, videos and your own notes in one library, with summaries and AI chat. It suits people who collect material and want to find the original evidence when they write.
Break down the problem and try your own design and implementation first. Then explore the reasoning to check states, edge cases, trade-offs, and ways to test your approach. The guide offers a reasoning path, not a complete implementation.
What should an old citation show after a source changes?
Design a citation checker for a teaching question-answering system. Each source has a cardId and an increasing integer revision. When an answer is generated, a snapshot records the (cardId, revision) used and its cited excerpt. Current sources may later change or be deleted. A snapshot is a fixed copy of the content used at that time; it does not change with the source.
- Check every citation and distinguish “current version matches,” “a newer version exists,” “currently deleted” and “snapshot missing.” Preserve the answer's original citation; never silently replace it with newer text.
- Example: an answer cites A@2 and B@1. Currently A is at revision 3 and B is deleted, but both snapshots remain. List each status and what readers can still inspect. Then remove the B@1 snapshot and repeat the reasoning.
- Deliver the data relationships, validation rules and a test table. Include multiple versions of one card, repeated citations, an empty citation list and nonexistent cards. You do not need to implement retrieval or a model.
Explore the reasoning
- Separate the current source index from the answer's snapshots. A citation key needs both the source identifier and revision. A cardId alone cannot identify the evidence used at the time.
- Check for a snapshot first, then compare the current revision. An update means current content differs; it does not automatically make the old answer wrong.
- A@2 is marked as updated and its snapshot remains readable. B@1 is currently deleted but its snapshot is readable. A missing snapshot is a gap; substituting another revision would no longer preserve the original citation.
- Use repeated citations and multiple versions to check stable ownership. State whether identical keys may be combined for display, while never merging evidence from different revisions.
How should late answers retain the right source context?
Design a teaching web interface for questions and answers. Users can choose Recall, Web or Both and add source cards. Each submission saves a requestId, scope and selected cardIds. Users may edit the settings after submission, and answers arrive asynchronously. This exercise does not describe Recall's internal implementation.
- Changes to the input settings must leave submitted request snapshots intact. An answer must show the scope and material it actually used, not the input box's current settings.
- Only the most recently submitted request may become the main result in this panel. Walk through q1(Recall, A) → change to Web → submit q2(Web, empty) → q2 succeeds → q1 succeeds. Also consider changing scope without submitting again.
- Deliver a state model, result-acceptance conditions and a test table. Cover cancellation, failure and retry, duplicate responses and no selected cards. Keyboard users must be able to choose a scope, add material and submit, with accessible loading and error messages.
Explore the reasoning
- Keep editable settings separate from the submitted snapshot. Editing settings does not relabel old answers. If the user edits without resubmitting, q1 may still appear with its original scope.
- Use the latest submitted requestId to decide which request may supply the main result. The example displays q2; late q1 cannot overwrite it. A retry gets a new identifier.
- AbortController can reduce unnecessary requests, but cancellation cannot replace an ownership check. Success, error and loading-completion callbacks must all check request identity.
- Control response order to verify that an old failure cannot clear a newer success. Then complete the workflow using only a keyboard: controls need names, visible focus and state messages accessible to assistive technology.