Skip to content

Replace Inkeep with keyword-only Algolia search - #6859

Open
Alek99 wants to merge 5 commits into
mainfrom
agent/keyword-only-algolia-search
Open

Replace Inkeep with keyword-only Algolia search#6859
Alek99 wants to merge 5 commits into
mainfrom
agent/keyword-only-algolia-search

Conversation

@Alek99

@Alek99 Alek99 commented Aug 7, 2026

Copy link
Copy Markdown
Member

What

  • replace the Inkeep search widget with a local keyword-only Algolia client
  • search the Reflex page index across framework docs, XY docs, components, API reference, blog posts, and marketing pages
  • remove @inkeep/cxkit-react and its OpenAI/AI transitive dependencies from the docs lockfiles
  • keep backward-compatible inkeep imports for downstream consumers
  • preserve Cmd/Ctrl+K, /, Escape, focus trapping/restoration, responsive styling, query debounce/cache, and Algolia attribution
  • portal the open dialog outside Safari's filtered-navbar stacking context while retaining the active Reflex light/dark theme
  • show distinct category-specific icons for XY, Components, API Reference, Docs, Blog, and general Reflex pages
  • explicitly disable analytics, click analytics, and personalization

Why

The existing Inkeep integration includes AI chat code and does not reliably surface all current Reflex pages. In particular, https://reflex.dev/docs/ai/integrations/anthropic/ was missing from site search even though it is present in the Algolia page index. This change queries that page index directly and keeps the search experience lexical only—no AI requests or AI search dependency.

Impact

The browser sends only standard Algolia keyword queries after a 350 ms debounce and two-character minimum. Results are limited to Reflex-owned URLs and the published search client requests at most 10 hits. Algolia crawler coverage and API-key rate limits are configured separately in the Algolia dashboard.

Verification

  • pytest -q tests/units/reflex_site_shared — 62 passed
  • pytest -q docs/app/tests/test_docs_navbar.py — 6 passed
  • focused search/plugin tests — 8 passed
  • Ruff check/format — passed
  • Biome format — passed
  • git diff --check — passed
  • reflex compile --dry — compiled 1,009 pages
  • reflex run --env prod --single-port — production build passed and Safari smoke-tested in light and dark mode
  • uv build --directory packages/reflex-site-shared — sdist and wheel passed

Manual Safari verification confirms anthropic returns the Anthropic integration page first.

Review in cubic

@greptile-apps

greptile-apps Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR replaces the Inkeep search integration with a client-only, keyword-based Algolia implementation while retaining deprecated compatibility imports.

  • Adds a themed, responsive Algolia search dialog with debouncing, caching, keyboard navigation, focus management, and URL filtering.
  • Publishes the shared TypeScript search asset through the site plugin and updates docs templates to use it.
  • Removes Inkeep and its transitive dependencies from the docs lockfiles.
  • Adds focused tests for the new component, compatibility aliases, and plugin assets.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains.

No blocking failure remains.

Important Files Changed

Filename Overview
packages/reflex-site-shared/src/reflex_site_shared/styles/assets/components/AlgoliaSearch.tsx Implements the client-side Algolia search dialog, result normalization, request lifecycle, accessibility behavior, theme-aware portal, and responsive styling; no eligible follow-up defect was established.
packages/reflex-site-shared/src/reflex_site_shared/components/algolia.py Defines the shared NoSSR Algolia component and navbar-compatible wrapper.
packages/reflex-site-shared/src/reflex_site_shared/components/inkeep.py Preserves the former Inkeep imports as deprecated aliases that render the Algolia replacement.
packages/reflex-site-shared/src/reflex_site_shared/plugins.py Adds the Algolia TypeScript component to the plugin’s published static assets.
packages/reflex-site-shared/src/reflex_site_shared/templates/docs.py Changes the default docs search control from Inkeep to the shared Algolia component.
docs/app/reflex.lock/bun.lock Removes Inkeep and its unused transitive dependencies from the generated frontend lockfile.
tests/units/reflex_site_shared/test_algolia.py Verifies the generated Algolia asset’s configuration and key interaction, request, accessibility, and styling contracts.

Reviews (5): Last reviewed commit: "docs: deprecate legacy Inkeep search ali..." | Re-trigger Greptile

@codspeed-hq

codspeed-hq Bot commented Aug 7, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 26 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing agent/keyword-only-algolia-search (ecc72f0) with main (333b78b)

Open in CodSpeed

Footnotes

  1. 8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@Alek99
Alek99 requested a review from carlosabadia August 7, 2026 21:01
@Alek99
Alek99 marked this pull request as ready for review August 7, 2026 21:02
@Alek99
Alek99 requested a review from a team as a code owner August 7, 2026 21:02

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0bf59e0fc9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/reflex-site-shared/src/reflex_site_shared/components/inkeep.py Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 14 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread tests/units/reflex_site_shared/test_algolia.py Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 5 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/reflex-site-shared/src/reflex_site_shared/styles/assets/components/AlgoliaSearch.tsx">

<violation number="1" location="packages/reflex-site-shared/src/reflex_site_shared/styles/assets/components/AlgoliaSearch.tsx:488">
P2: Changing a query leaves prior-query links clickable until the replacement request completes, so a click can navigate to a result unrelated to the visible query. Clear `hits` when a cache miss starts (or hide results during loading) before exposing the new query.</violation>
</file>

<file name="packages/reflex-site-shared/src/reflex_site_shared/components/inkeep.py">

<violation number="1" location="packages/reflex-site-shared/src/reflex_site_shared/components/inkeep.py:16">
P3: Deprecation warnings identify `inkeep.py` rather than the downstream legacy call site, so users cannot locate usages and separate callers share one dedupe key. Treat `reflex_site_shared` as a framework frame (or add caller-location support to `console.deprecate`) before emitting this warning.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

}, [isOpen]);
const activeResultId =
activeIndex >= 0 ? `${resultsId}-result-${activeIndex}` : undefined;
const showResults =

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Changing a query leaves prior-query links clickable until the replacement request completes, so a click can navigate to a result unrelated to the visible query. Clear hits when a cache miss starts (or hide results during loading) before exposing the new query.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/reflex-site-shared/src/reflex_site_shared/styles/assets/components/AlgoliaSearch.tsx, line 488:

<comment>Changing a query leaves prior-query links clickable until the replacement request completes, so a click can navigate to a result unrelated to the visible query. Clear `hits` when a cache miss starts (or hide results during loading) before exposing the new query.</comment>

<file context>
@@ -467,28 +448,45 @@ export function AlgoliaSearch() {
+  }, [isOpen]);
+  const activeResultId =
+    activeIndex >= 0 ? `${resultsId}-result-${activeIndex}` : undefined;
+  const showResults =
+    status !== "idle" && (status !== "loading" || hits.length > 0);
 
</file context>

Args:
feature_name: The legacy entry point used by the caller.
"""
console.deprecate(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: Deprecation warnings identify inkeep.py rather than the downstream legacy call site, so users cannot locate usages and separate callers share one dedupe key. Treat reflex_site_shared as a framework frame (or add caller-location support to console.deprecate) before emitting this warning.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/reflex-site-shared/src/reflex_site_shared/components/inkeep.py, line 16:

<comment>Deprecation warnings identify `inkeep.py` rather than the downstream legacy call site, so users cannot locate usages and separate callers share one dedupe key. Treat `reflex_site_shared` as a framework frame (or add caller-location support to `console.deprecate`) before emitting this warning.</comment>

<file context>
@@ -1,8 +1,55 @@
+    Args:
+        feature_name: The legacy entry point used by the caller.
+    """
+    console.deprecate(
+        feature_name=feature_name,
+        reason="Use the keyword-only Algolia search API instead.",
</file context>

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.

2 participants