For "what X did we discuss / which ones / what did we talk about" style
enumeration and topic-discovery questions, the model was brute-forcing
search_messages across many keyword-guess rounds instead of using vector
search. Strengthen the semantic-search guidance to send these questions to
semantic_search_current_chat and explicitly discourage multi-round keyword
guessing; restrict search_messages to known exact word/quote/sender/time.
Co-authored-by: Cursor <cursoragent@cursor.com>
Evidence messages carry millisecond timestamps but the preprocessing pipeline
renders times assuming seconds (multiplies by 1000), producing absurd years
(e.g. 56150) inside semantic snippets. Convert ms back to seconds before
rendering. Also strip the per-line time prefix from semantic snippets so the
evidence block shows a single group time instead of a time on every message,
and drop the redundant time span in the group header. Adds regression tests.
Co-authored-by: Cursor <cursoragent@cursor.com>
Drop the per-source timestamp line and show a single overall time per group
(falling back to the source min/max when no group range is set). Each source
now renders as a compact sender + snippet line, reducing visual clutter.
Co-authored-by: Cursor <cursoragent@cursor.com>
The evidence block is now collapsed by default, showing only a compact header
with per-status group counts and the retrieval mode. Expanding reveals query,
criteria, warnings, grouped sources and a total-sources footnote. Tightens
spacing throughout.
Co-authored-by: Cursor <cursoragent@cursor.com>
Add a structured "evidence" content block produced by retrieve_chat_evidence:
extract the payload from tool results, persist it in AI chat history, and
render grouped, desensitized sources in EvidenceBlock.vue. Sources open the
chat record drawer at the matched message for traceability. Evidence payload
types move to @openchatlab/core so tools, node-runtime and the frontend share
one definition. Includes zh-CN/en-US/ja-JP/zh-TW i18n.
Co-authored-by: Cursor <cursoragent@cursor.com>
Add an "evidence" planner intent and tiered retrieval guidance so
fact/occurrence/count questions are routed to retrieve_chat_evidence
instead of a single low-level search path.
- planner: new evidence intent + prompt strategy suggesting only
retrieve_chat_evidence for that step
- semantic-search guidance: three-tier tool selection (evidence > semantic > keyword)
- expose retrieve_chat_evidence as an always-on Agent tool (desktop special
append; CLI via AGENT_TOOL_REGISTRY core), semantic tool stays dynamic
- export evidence tool + payload types from @openchatlab/tools
- TDD: planner evidence-intent test
Co-authored-by: Cursor <cursoragent@cursor.com>
Thread an optional timeFilter through SemanticSearchToolOptions →
searchForTool → search → hybridSearch so evidence retrieval no longer
mixes time ranges between semantic and keyword paths.
- hybridSearch filters dense + FTS-mapped chunks by startTs/endTs overlap
(millisecond, single-sided supported) and amplifies the candidate pool
when filtering to avoid under-recall
- retrieve_chat_evidence now passes its parsed ms range to the semantic path
- TDD: hybrid-search overlap unit tests + service wiring test
Co-authored-by: Cursor <cursoragent@cursor.com>
Introduce a high-level evidence retrieval tool for fact/occurrence/count
questions. It resolves auto mode, runs semantic + keyword paths, de-identifies
keyword snippets via an injected desensitizeMessages callback, applies a
tool-layer millisecond time-range fallback (keyword path can't rely on the CLI
provider's timeFilter), and merges/dedupes candidates into conservative groups.
- Add ChatEvidencePayload / group / source types and EvidenceTimeRangeMs to tools
- Register tool in AGENT_TOOL_REGISTRY only (Agent-only, excluded from MCP)
- Inject desensitizeMessages (preprocessMessages) in desktop + CLI adapters
- TDD: tool + registry unit tests
Co-authored-by: Cursor <cursoragent@cursor.com>
Add the missing translations for the v8 database migration across the
desktop locales and cover them with a regression assertion.
Co-authored-by: Cursor <cursoragent@cursor.com>
Add the frontend semantic-index service layer and the index management UI:
a settings section for vector model selection and index lifecycle with live
build-progress polling, a conversation picker plus current-conversation
entry, a session-scoped modal, and the tool-block summary rendering in the
chat message flow. Include the en/ja/zh-CN/zh-TW translations.
Co-authored-by: Cursor <cursoragent@cursor.com>
Add shared /_web/ai/semantic-index HTTP routes and wire the service into
CLI web and Electron internal API. Introduce the semantic_search_current_chat
agent tool (AGENT-only, not MCP) with desensitized output and a narrowed
service interface, forward the semantic-search context through the CLI and
Desktop tool adapters, and integrate on-demand semantic search into the
agent pipeline with guidance and a max-result-token evidence budget.
Co-authored-by: Cursor <cursoragent@cursor.com>
Remove the deprecated always-on RAG system and introduce the new
semantic-index core: parent/child chunker with version/hash derivation,
embedding providers (local + OpenAI-compatible) and profiles, sqlite-vec
vector store, dense+FTS+RRF hybrid retrieval, evidence assembly, serial
warmup job queue and single-session runner, session business-state store,
and the SemanticIndexService that ties them together. Add an independent
config store and a dedicated vector directory via the path providers.
Co-authored-by: Cursor <cursoragent@cursor.com>
- capture worker reference in sendToWorkerWithProgress to match
sendToWorker and avoid stale-closure risk on worker restart
- replace `as any` casts with typed SupportedLocale / BatchSegmentOptions
assertions in debug-executor
- destructure params.params as toolParams to remove unused testId binding
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Switching to a different session left allWords/topicMiniWords/stats
populated with the previous session's data. With the earlier fix that
skips isLoading when allWords is non-empty, users could see and interact
with stale words until the new request resolved.
Extend the sessionId watcher to also clear all word cloud state so the
loading indicator triggers correctly for cross-session navigation while
still keeping old data visible for same-session filter refinements.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- quick-start: simplify download links, add clb alias tip, improve copy
- intro: expand with features, supported platforms table, and next steps
- index: optimize title and descriptions for GEO/SEO
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add CN/EN acknowledgments pages with Leo Oliveira story
- Add English translations of Push and Pull protocol docs
- Register acknowledgments in sidebar as top-level entry
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Mark iMessage as supported, remove WeChat from EN README
- Update dev setup to reflect interactive target selector
- Add docs site links to docs/README.md
- Remove single-PR rule, highlight feature discussion requirement
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace per-component truncateName copies with the shared truncateRankName
from rankingChartLayout, and fix its ellipsis character to '…' (U+2026).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The language-preference endpoint calls createJiebaNlpProvider() which
uses the on-disk zh-CN dict. If the result was cached before the dict
was downloaded, the built-in fallback tokenization was served even after
the dict became available, until a DB write invalidated the cache.
Include the zh-CN dict file mtime/size as extraVersion in the cache
version so the entry is recomputed whenever the dict is added, replaced,
or deleted — consistent with the word-frequency fix.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When no dict was downloaded, word-frequency results were computed with
the built-in tokenizer and cached. Downloading a dict cleared the in-
memory Jieba instance but left the cached result unchanged, so subsequent
requests returned the lower-quality built-in tokenization until the chat
DB was modified.
Add an extraVersion option to withAnalyticsCache and pass the dict file's
mtime/size as extraVersion for word-frequency requests so the cache is
invalidated whenever the dict file is added, replaced, or deleted.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
getDivingAnalysis and getNightOwlAnalysis derive values from the current
date (daysSinceLastMessage, currentStreak) that change even when the DB
file is untouched. Without a date component in the cache version, stale
results were returned until the next import or DB write.
Add a dailyInvalidate option to withAnalyticsCache that appends today's
date to the version string, and enable it for the diving and night-owl
endpoints.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The desktop worker kept a second analytics result cache in the same
cacheDir/query directory but invalidated it with a fragile scheme:
app-version .cache_version file, a dev-startup wipe, and explicit
invalidateAnalysisCache() calls after import. Replace it with the shared
getOrComputeAnalysisCache, fingerprinting entries by product version plus
the session DB file state, so the worker (still used by AI tools and the
desktop public REST API) and the shared HTTP routes share one cache and
one invalidation model. Fold the product version into the HTTP-route
fingerprint too, preserving the cross-release invalidation that
.cache_version used to provide, and drop the now-dead invalidation code.
Co-authored-by: Cursor <cursoragent@cursor.com>
Repeatedly switching time filters recomputed expensive analytics/NLP
queries from scratch (e.g. a 1-year word cloud took 10s+ after a detour
through 5-year), because cancelling the network request cannot stop the
synchronous server-side computation. Add a shared, platform-agnostic
disk cache under cacheDir/query, validated by a fingerprint derived from
the session DB file (mtime+size of the main file and its -wal sidecar) so
any import, incremental import or member edit transparently invalidates
it. Wire it through the shared HTTP routes (word-frequency plus all
analytics endpoints), so CLI Web and the desktop internal server share
one implementation.
Co-authored-by: Cursor <cursoragent@cursor.com>
Switching the time filter or active session while analytics requests are
in flight left obsolete requests pending, exhausting the browser's
per-origin connection budget and letting stale responses overwrite fresh
data. Introduce an AbortController-backed analytics request epoch
(analyticsGet/analyticsPost) that is reset whenever the filter or session
changes, silencing AbortError so cancelled requests never settle the UI.
Co-authored-by: Cursor <cursoragent@cursor.com>
Switching the word count (80/100/150/200/300) in Insights > Topics >
Wordcloud re-ran a full-corpus jieba segmentation on the Electron main
thread, since topN only affects the final slice while the segmentation
cost is independent of it. This blocked the main process and froze the UI.
- Frontend: fetch the full word list once (max tier) and slice locally on
word-count change, recomputing percentages over the displayed subset.
Word-count switching no longer hits the backend or triggers segmentation.
- Backend: for Chinese meaningful/custom mode, produce word frequency and
POS-tag stats in a single jieba.tag pass instead of two, halving CPU for
genuine recomputes (filter/time/member changes). Behavior is preserved
(verified by an equivalence regression test).
Co-authored-by: Cursor <cursoragent@cursor.com>
Analysis pages (private/group chat) are lazy-loaded routes that pull in
heavy deps (echarts, markdown-it, snapdom, vue-virtual, etc.) which Vite's
cold-start scan does not discover. The first navigation triggered an
in-flight dependency re-optimization, invalidating already-loaded chunks
and failing with 504 (Outdated Optimize Dep) on the dynamically imported
page module. This surfaced after a fresh pnpm install wiped the warm
node_modules/.vite cache.
Add optimizeDeps.include so the initial optimize pass already contains
these deps, preventing mid-session re-optimization and the 504.
Co-authored-by: Cursor <cursoragent@cursor.com>
The /_web/sessions route never called getAIChatCountsBySession() to
enrich session DTOs, leaving aiConversationCount always 0 in the
data management UI. Use the existing enrichSession callback and
AIChatManager to fill real counts for both list and detail endpoints.
Co-authored-by: Cursor <cursoragent@cursor.com>
Keep only the latest 3 versions in Cloudflare R2 to stay within
storage limits. Triggered automatically after each stable release
and manually via workflow_dispatch.
Co-authored-by: Cursor <cursoragent@cursor.com>
In CLI Web mode, the frontend displays __APP_VERSION__ injected from the
root package.json at build time (0.26.2), while the server-side getVersion()
reads apps/cli/package.json at runtime (stuck at 0.25.1). This caused
buildWebUpdateCheckResult to compare remote 0.26.2 against local 0.25.1,
permanently reporting a false update notice even when the user was already
on the latest version.
Fix apps/cli/package.json to 0.26.2 to align with the product version.
Also extend set_release_version.sh to keep apps/cli/package.json in sync
with the root package.json on every release, preventing the drift from
recurring. apps/desktop/package.json is intentionally kept at 0.0.0 (the
desktop runtime uses app.getVersion() with __APP_VERSION__ fallback).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy favicon.ico from chatlab.fun and serve it via Vite's publicDir
(src/public/). Update index.html to reference the standard /favicon.ico
path; the previous /assets/imgs/favicon.ico path had no backing file.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>