Skip to content

feat: AI Search plugin with indexing, search modal, and demo site - #633

Merged
khoinguyenpham04 merged 39 commits into
emdash-cms:mainfrom
ttmx:feat/ai-search-plugin-v2
Aug 5, 2026
Merged

feat: AI Search plugin with indexing, search modal, and demo site#633
khoinguyenpham04 merged 39 commits into
emdash-cms:mainfrom
ttmx:feat/ai-search-plugin-v2

Conversation

@ttmx

@ttmx ttmx commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds a Cloudflare-native AI Search plugin for EmDash, powered by Cloudflare AI Search. This includes:

  • A Cloudflare integration in packages/cloudflare/ that indexes content into an AI Search namespace via the native worker binding, with content-sync hooks, a cron-flushed reindex queue, query synonyms, an index-status endpoint, and a settings admin UI
  • Updates to the existing Cloudflare demo (demos/cloudflare/) that register the AI Search binding, add a cron trigger to flush the reindex queue, and add a /search page backed by the plugin's query endpoint

Type of change

  • Bug fix
  • Feature (requires maintainer-approved Discussion)
  • Refactor (no behavior change)
  • Translation
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

AI-generated code disclosure

  • This PR includes AI-generated code — model/tool: OpenCode with GPT 5.5 and later GPT-5.6 Sol

Screenshots / test output

image

@changeset-bot

changeset-bot Bot commented Apr 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5b05bc0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 17 packages
Name Type
@emdash-cms/cloudflare Minor
@emdash-cms/fixture-perf-site Patch
@emdash-cms/perf-demo-site Patch
@emdash-cms/cache-demo-site Patch
@emdash-cms/do-demo-site Patch
@emdash-cms/do-solo-demo-site Patch
emdash Minor
@emdash-cms/admin Minor
@emdash-cms/auth Minor
@emdash-cms/blocks Minor
@emdash-cms/gutenberg-to-portable-text Minor
@emdash-cms/x402 Minor
create-emdash Minor
@emdash-cms/sandbox-workerd Patch
@emdash-cms/plugin-mcp-smoke Major
@emdash-cms/auth-atproto Patch
@emdash-cms/plugin-embeds Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

Scope check

This PR changes 11,732 lines across 42 files. Large PRs are harder to review and more likely to be closed without review.

If this scope is intentional, no action needed. A maintainer will review it. If not, please consider splitting this into smaller PRs.

See CONTRIBUTING.md for contribution guidelines.

@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

This PR has been inactive for 14 days. It will be closed automatically in 7 days if there is no further activity.

If you're still working on this, please push an update or leave a comment.

@github-actions github-actions Bot mentioned this pull request May 6, 2026
18 tasks
@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

Overlapping PRs

This PR modifies files that are also changed by other open PRs:

This may cause merge conflicts or duplicated work. A maintainer will coordinate.

@pkg-pr-new

pkg-pr-new Bot commented Jul 16, 2026

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

npm i https://pkg.pr.new/@emdash-cms/admin@633

@emdash-cms/auth

npm i https://pkg.pr.new/@emdash-cms/auth@633

@emdash-cms/auth-atproto

npm i https://pkg.pr.new/@emdash-cms/auth-atproto@633

@emdash-cms/blocks

npm i https://pkg.pr.new/@emdash-cms/blocks@633

@emdash-cms/cloudflare

npm i https://pkg.pr.new/@emdash-cms/cloudflare@633

@emdash-cms/contentful-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/contentful-to-portable-text@633

emdash

npm i https://pkg.pr.new/emdash@633

create-emdash

npm i https://pkg.pr.new/create-emdash@633

@emdash-cms/gutenberg-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/gutenberg-to-portable-text@633

@emdash-cms/plugin-cli

npm i https://pkg.pr.new/@emdash-cms/plugin-cli@633

@emdash-cms/plugin-types

npm i https://pkg.pr.new/@emdash-cms/plugin-types@633

@emdash-cms/registry-client

npm i https://pkg.pr.new/@emdash-cms/registry-client@633

@emdash-cms/registry-lexicons

npm i https://pkg.pr.new/@emdash-cms/registry-lexicons@633

@emdash-cms/registry-verification

npm i https://pkg.pr.new/@emdash-cms/registry-verification@633

@emdash-cms/sandbox-workerd

npm i https://pkg.pr.new/@emdash-cms/sandbox-workerd@633

@emdash-cms/x402

npm i https://pkg.pr.new/@emdash-cms/x402@633

@emdash-cms/plugin-ai-moderation

npm i https://pkg.pr.new/@emdash-cms/plugin-ai-moderation@633

@emdash-cms/plugin-atproto

npm i https://pkg.pr.new/@emdash-cms/plugin-atproto@633

@emdash-cms/plugin-audit-log

npm i https://pkg.pr.new/@emdash-cms/plugin-audit-log@633

@emdash-cms/plugin-color

npm i https://pkg.pr.new/@emdash-cms/plugin-color@633

@emdash-cms/plugin-embeds

npm i https://pkg.pr.new/@emdash-cms/plugin-embeds@633

@emdash-cms/plugin-field-kit

npm i https://pkg.pr.new/@emdash-cms/plugin-field-kit@633

@emdash-cms/plugin-forms

npm i https://pkg.pr.new/@emdash-cms/plugin-forms@633

@emdash-cms/plugin-webhook-notifier

npm i https://pkg.pr.new/@emdash-cms/plugin-webhook-notifier@633

commit: 5b05bc0

emdashbot Bot and others added 28 commits August 5, 2026 18:10
Cloudflare reports a missing AI Search instance as AiSearchNotFoundError
with the message ai_search_not_found, which the missing-instance check did
not match. The metadata route therefore answered 503 for a fresh or deleted
instance instead of reporting it as repairable.
The info() probe treated every failure as a missing instance, so a transient
error or an auth failure triggered a spurious create and a second failure.
Rethrow anything that is not a recognized missing-instance error, and when a
concurrent initializer wins the create, re-probe rather than surfacing it.
Several AI Search call sites imported the module independently on every
operation. Share one cached import, keeping the rejection uncached so a
later call can retry.
Saving a narrower collection selection left the already-uploaded items of the
removed collections searchable, since the selection only gated later content
hooks. Persist the selection first, then delete the mirrored documents whose
collection is no longer selected.
Configured plugins have no install hook, so the content hooks only cover
content created or updated after AI Search is enabled. Document the manual
full sync as a required setup step, and correct the admin page name.
@khoinguyenpham04
khoinguyenpham04 force-pushed the feat/ai-search-plugin-v2 branch from 10a8069 to 5b05bc0 Compare August 5, 2026 17:10
@emdashbot emdashbot Bot mentioned this pull request Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants