Skip to content

feat: configure embedding request size and timeout in Search settings - #1357

Open
KGESH wants to merge 2 commits into
inkeep:mainfrom
KGESH:feat/embedding-request-settings
Open

feat: configure embedding request size and timeout in Search settings#1357
KGESH wants to merge 2 commits into
inkeep:mainfrom
KGESH:feat/embedding-request-settings

Conversation

@KGESH

@KGESH KGESH commented Aug 22, 2026

Copy link
Copy Markdown

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:

Field Config key Default
Maximum text chunks per indexing request search.semantic.maxBatchSize 96
Character budget per indexing request search.semantic.maxBatchChars 96000
Indexing request timeout (seconds) search.semantic.docTimeoutMs 30 s (30000 ms)

packages/server/src/embeddings/embedder.ts already 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.

Collapsed — a sibling of Custom endpoint Expanded — the three fields at their defaults
Settings → This project → Search, with the Embedding request settings disclosure collapsed below Custom endpoint The Embedding request settings disclosure expanded, showing the chunk count, character budget, and timeout fields

How this was verified

Rebased on main at 70a8e0c.

  • pnpm run check (lint, typecheck 11/11, build, tests) — 3633/3634 passed. The one failure is packages/core/src/y-prosemirror-patch.test.ts → "dep-tree invariant: no destructive delete in any shipped bundle", which walks node_modules and hit its 30s limit while the desktop pty-flood test (28.6s) ran concurrently. It passes standalone in 8.2s and is untouched by this change.
  • Scoped runs: packages/core config 522 passed · packages/server embeddings + api-search-semantic-factory 111 passed · packages/app settings 223 passed.
  • Tests added/updated: 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 a tests/stress/settings-search.e2e.ts case.
  • Docs: docs/content/reference/configuration.mdx step 4, framed as an override rather than a recommended preset.
  • Changeset: .changeset/configure-embedding-transport.md.

26 of the 50 changed files are generated lingui catalogs under packages/app/src/locales/pnpm run i18n reproduces them with zero drift. New msgids land with empty msgstr for non-English locales, leaving them to the usual translation pass.

Checklist

  • Ran pnpm check (lint, typecheck, tests) locally
  • Added a changeset (pnpm changeset) if this changes behavior
  • Updated docs if this changes a user-facing surface
  • I have read CONTRIBUTING.md and agree to license my contribution under the project's terms (CLA)

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`.
@KGESH
KGESH deployed to inkeep-oss-sync August 22, 2026 03:16 — with GitHub Actions Active
@CLAassistant

CLAassistant commented Aug 22, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions

Copy link
Copy Markdown

Thanks for the contribution!

What happens next:

  • A maintainer will review your PR.
  • If you don't hear back within a few business days, please comment here to nudge our team.
  • This repository is maintained through an internal mirror. When your change is accepted, this PR will close automatically. Don't be alarmed when it closes — that's how it merges, and your authorship is preserved.

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