Skip to content

Show retrieval speed in the demo-mode web UI#45

Merged
Neverdecel merged 1 commit into
masterfrom
claude/ui-demo-search-speed
Jun 17, 2026
Merged

Show retrieval speed in the demo-mode web UI#45
Neverdecel merged 1 commit into
masterfrom
claude/ui-demo-search-speed

Conversation

@Neverdecel

Copy link
Copy Markdown
Owner

What & why

Follow-up to #44 (the MCP surface + the "find code faster than a grep loop" README pitch). That pitch's core claim — fast local retrieval — was only a number in the docs. This makes it tangible in the product: in demo mode, the web UI now shows how fast a hybrid search was, right next to the results count:

1 result        ⚡ 12 ms  over 553 chunks · 90 files

It's deliberately scoped to demo mode (the public showcase) and framed as retrieval time only — clearly separate from the optional, slower LLM "Generate answer" step (which stays its own section).

Changes

  • webui.py_run_search times the .search() call (retrieval only — not filtering/highlighting) with time.perf_counter, and home() passes search_ms to the template.
  • templates/index.html + static/app.css — a .speed-badge rendered only under {% if demo %}; outside demo mode the UI is unchanged. The badge is labelled "Local hybrid retrieval time — separate from the optional AI answer".
  • api.py — new CodeRAG.warm() (loads provider/store/vectors and the embedding model) so the first demo query reflects warm latency instead of the one-off lazy model load. run_ui and the MCP server's _warm_up now both route through it (one shared warm path).
  • templates/base.html — demo banner reworded to frame search as instant/local and AI answers as a separate, capped step.
  • tests/test_webui.py — badge present in demo mode (+ the reworded banner), absent otherwise.

Verification

  • pytest -m "not integration"141 passed; ruff check / ruff format --check / mypy coderag clean.
  • Rendered markup verified via TestClient + the fake provider (the real model download isn't reachable in this sandbox). On real corpora the badge reads e.g. "⚡ 12 ms over 553 chunks · 90 files".

Not in scope (deferred)

  • Per-stage breakdown (dense vs lexical vs rerank) — would need to instrument HybridSearcher.
  • elapsed_ms on the HTTP API /search and MCP search_code responses.
  • Any always-on (non-demo) speed display.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PKDkohprCqYpiLmB1xx4sC


Generated by Claude Code

In demo mode, surface how fast a hybrid search is — a "⚡ N ms over X chunks ·
Y files" badge beside the results count — so a public demo makes CodeRAG's core
speed advantage tangible, clearly separate from the optional, slower AI answer.

- webui: time the .search() call in _run_search and pass search_ms to the home
  template; render the badge only under {% if demo %}.
- api: add CodeRAG.warm() (loads provider/store/vectors + the embedding model) so
  the first demo query reflects warm latency, not the one-off lazy model load;
  run_ui and the MCP server's _warm_up now both use it.
- templates/css: demo-only .speed-badge; reword the demo banner to frame search
  as instant and local, and AI answers as a separate, capped step.
- tests: badge present in demo mode (+ reworded banner), absent otherwise.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PKDkohprCqYpiLmB1xx4sC
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 81.81818% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
coderag/surfaces/webui.py 71.42% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@Neverdecel Neverdecel merged commit cd744b6 into master Jun 17, 2026
12 checks passed
@Neverdecel Neverdecel deleted the claude/ui-demo-search-speed branch June 18, 2026 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants