Changelog

What changed between DeepCQ releases, newest first. Each entry lists the new public API and any change to scores or returned content, so you can tell whether an upgrade needs a recalibration pass.

Current release: 0.3.0 Next: 0.3.1

At a glance

Dates are PyPI upload dates. All scoring options added after 0.1.0 are opt-in. At their defaults, scores match the previous release, except for the 0.3.1 fixes.

VersionReleasedHeadlineNew public API
0.3.1Not yet on PyPIMatching fixes, loud fallbackfallback_counts, reset_fallback_counts
0.3.02026-10-20Synonyms, phrases, tier weights, calibrationSynonymMap, load_pack, calibrate, LabeledExample, ThresholdStats, CalibrationReport, TIER_NAMES
0.2.12026-07-11Recency decay, score explanationsScoreExplanation, Recency, no_decay, exponential_decay, linear_decay
0.2.0Not publishedLiteral anchors, locate()locate, Candidate
0.1.02026-07-10Initial releaseDeepCQ, MemorySchema, QueryResult, OptimizationMetrics and the five tier classes

0.3.1Matching fixes and loud fallback

Not yet on PyPI. Recalibrate after upgrading. Several of these fixes change scores or returned content by default. Thresholds tuned against 0.3.0 may need another pass with calibrate().

Fixed

  • Literal anchors match only the exact figure or whole word. In 0.3.0 an anchor was a plain substring test, and an anchor hit forces a score of 1.0. So “is 10 a good entry?” force-included every section that contained “100”, “2010” or “2.10”.
    • “10” no longer matches “100”, “2010”, “2.10”, “10.5”, “10th”, “10-K” or “10-year”. It still matches “top 10”, “$10” and the range “10-15%”.
    • “15%” no longer matches “115%”, “15.5%”, “-15%” or “−15%”.
    • Extracted numbers keep a leading minus sign, so “-15%” and “15%” are different anchors, and “-15%” doesn’t match the range “10-15%”.
    • Matching is textual: “1000” doesn’t match “1,000”, and “15” doesn’t match “15.0”.
  • Section headers end at a word boundary. "## SEC" no longer matches a "## Sector" header.
  • Sections that no tier contains score 0.0. Before, a match on a section’s name or keywords alone gave it a passing score, and the section was listed in sections_included with no content. These sections now have ScoreExplanation.present = False and appear only in the new QueryResult.sections_absent. ScoreExplanation.absent_score keeps the score that the name and keywords would have given.
  • A query that matches only absent sections returns no section content. The query asks about data that memory doesn’t hold, so it no longer triggers the include-all fallback, which used to return all of memory.
  • Headers must start a line in the sectioned tiers (state, notes, reference). A mid-line mention such as “see [status] for uptime” started the status section at that line, so the wrong text was scored and returned and the real section was lost. The free-text tiers (cache, history) still score a section from a mention anywhere in a line, such as “USER: [deploy] failed”, using the new MemorySchema.mention_pattern().
  • Data lines no longer end a section. With the default "[{name}]" header format, any line that started with [ ended the section. That cut off content after lines such as [AAPL, MSFT], ["a", "b"] or a Markdown link. A section now ends at the next header line. A header line is either a declared section’s header, or the header format filled with a name that starts with a letter and has no commas, quotes or brackets, followed by a space or the end of the line. Formats with nothing after {name}, such as "## {name}", behave as before.
  • reduction_pct is never negative. Returned pieces are now joined with a single newline, like the original text, instead of a blank line. The filtered content can no longer be longer than the input.

Added

  • Loud fallback. When fallback_include_all returns all of memory unfiltered, the result has fallback_used = True and a fallback_reason, and a warning is logged on the "deepcq" logger, with the query cut to 80 characters. deepcq.fallback_counts() returns process-wide totals by kind (no_section_scored, no_section_present, absent_only), and deepcq.reset_fallback_counts() sets them back to zero.
  • QueryResult.sections_absent, ScoreExplanation.present and ScoreExplanation.absent_score, described under Fixed.

0.3.0Synonyms, phrases, tier weights and calibration

Released 2026-10-20. All new scoring options are opt-in MemorySchema fields. At their defaults, scores are identical to 0.2.1; this was checked against a copy of the 0.2.1 scorer. Full rules are in the 0.3.0 specification.

Added

  • Synonym vocabularies. Set vocabulary= to a SynonymMap, or use the built-in load_pack("finance"). A section’s vocabulary is expanded with every synonym cluster that has a term in that section, so “eps” matches stored “earnings per share” and the other way round. Only the section side is expanded, so the query’s token count, which is the score’s denominator, doesn’t change.
  • Phrase matching. phrase_sizes and phrase_boost add a capped bonus for multi-word phrases (stemmed n-grams) that match. The bonus can only raise a score.
  • Per-tier weighting. tier_weights and schema_weight weight a match by where it was found. Each query token counts once, at the highest weight among the tiers and the section name it appears in. ScoreExplanation gains tier_contributions and matched_phrases.
  • Threshold calibration. calibrate() tries a range of thresholds over a list of LabeledExamples, running one query() per example, and reports micro-averaged precision, recall and F1 for each threshold. An optional min_precision floor is flagged when no threshold meets it.
  • locate() supports anchor_patterns and recency, and reports match details for each chunk.

Changed

  • Per-tier vocabulary caching. Each memory tier has a version counter that every write increments. Extracted section text and tokens are cached per schema and section, so unchanged tiers skip regex extraction and tokenization on the next query.

0.2.1Recency decay and score explanations

Released 2026-07-11.

Added

  • Recency decay. Section scores can be weighted by age through a pluggable Recency setting or decay_fn. no_decay, exponential_decay and linear_decay are included.
  • Score explanations. ScoreExplanation reports which tokens and anchors produced each section’s score, for debugging and for interfaces that show users why a section was included.
  • Anchor extraction recognizes version numbers, percentages, identifiers and plain numbers, and the patterns can be overridden on the schema.

Fixed

  • A percentage anchor such as “15%” no longer also produces a duplicate bare-number anchor (“15”). The anchor patterns used to be matched independently, without tracking which parts of the query had already matched.

0.2.0Literal anchors and locate()

Never uploaded to PyPI. Its changes were first published in 0.2.1.

Added

  • Literal-anchor matching. Emoji, symbols and quoted phrases in a query force a section to be included when it contains them, even when word overlap alone would miss it.
  • locate() finds the relevant chunks of a plain document in one call, without setting up DeepCQ or a MemorySchema. It returns Candidate objects. See Search plain documents.

0.1.0Initial release

Released 2026-07-10.

  • DeepCQ and MemorySchema: declare named sections and score each one against the words of the query, using regex and a light stemmer. No embeddings and no runtime dependencies.
  • Five memory tiers: AppState, SessionCache, History, LongTermStore and ReferenceData.
  • QueryResult with filtered content, scores, included and excluded sections, and OptimizationMetrics.