feat: configure embedding request size and timeout in Search settings - #1357
Open
KGESH wants to merge 2 commits into
Open
feat: configure embedding request size and timeout in Search settings#1357KGESH wants to merge 2 commits into
KGESH wants to merge 2 commits into
Conversation
Expose the semantic-search embedding request knobs — document batch count, per-request character budget, and indexing timeout — in Settings → This project → Search, so a slow or memory-constrained local embedding server can be tuned without patching the installed bundle. The fields read/write the existing `search.semantic.maxBatchSize` / `maxBatchChars` / `docTimeoutMs` project-local config that the embedder already honors; clearing a field resets it to the shipped default (96 / 96000 / 30000 ms). "Embedding request settings" is a sibling disclosure of "Custom endpoint", not a child: the knobs apply to whatever endpoint is in use, default OpenAI included, so nesting them would hide them from anyone who never set a custom endpoint. Each disclosure auto-expands on its own overrides, so a value set from the CLI is never invisible in Settings. Locale catalogs regenerated via `pnpm run i18n`.
|
Thanks for the contribution! What happens next:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Semantic search embeds documents with a fixed batch size, per-request character budget, and a 30s per-document timeout. Those are fine for a hosted OpenAI-compatible endpoint, but a local embedding server is much slower — on my Ollama setup indexing kept failing on that hardcoded timeout, with no way to raise it short of patching the installed OpenKnowledge bundle.
This exposes the three knobs in Settings → This project → Search:
search.semantic.maxBatchSize96search.semantic.maxBatchChars96000search.semantic.docTimeoutMs30s (30000ms)packages/server/src/embeddings/embedder.tsalready accepted all three as options — they just had no config-schema entry and no Settings path. Clearing a field resets it to the shipped default. These are overrides for unusual endpoints, not presets; the defaults stay the recommendation for everyone else.The fields sit as a sibling of the existing Custom endpoint disclosure rather than inside it: they apply to whatever endpoint is in use, the default one included, so nesting them would hide them from everyone who never set a custom endpoint. Each disclosure auto-expands when it has an override, so a value set from the CLI is never invisible in Settings.
How this was verified
Rebased on
mainat 70a8e0c.pnpm run check(lint, typecheck 11/11, build, tests) — 3633/3634 passed. The one failure ispackages/core/src/y-prosemirror-patch.test.ts→ "dep-tree invariant: no destructive delete in any shipped bundle", which walksnode_modulesand hit its 30s limit while the desktoppty-floodtest (28.6s) ran concurrently. It passes standalone in 8.2s and is untouched by this change.packages/coreconfig 522 passed ·packages/serverembeddings +api-search-semantic-factory111 passed ·packages/appsettings 223 passed.SearchSection.dom.test.tsx,settings-search-index.test.ts,core/src/config/schema.test.ts,schema-jsonschema.test.ts,field-registry.test.ts,server/src/embeddings/{embedder,semantic-config,semantic-search-service}.test.ts, plus atests/stress/settings-search.e2e.tscase.docs/content/reference/configuration.mdxstep 4, framed as an override rather than a recommended preset..changeset/configure-embedding-transport.md.26 of the 50 changed files are generated lingui catalogs under
packages/app/src/locales/—pnpm run i18nreproduces them with zero drift. New msgids land with emptymsgstrfor non-English locales, leaving them to the usual translation pass.Checklist
pnpm check(lint, typecheck, tests) locallypnpm changeset) if this changes behavior