Skip to content

[AI-186] States and background processing for Semantic Indexes - #7

Open
xhr15 wants to merge 7 commits into
implementation/ai-178-crud-for-semantic-indexesfrom
implementation/ai-186-states-and-background-processing-for-semantic-indexes
Open

xhr15 wants to merge 7 commits into
implementation/ai-178-crud-for-semantic-indexesfrom
implementation/ai-186-states-and-background-processing-for-semantic-indexes

Conversation

@xhr15

@xhr15 xhr15 commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Ticket

https://community.openproject.org/wp/AI-186

What it's about:

Semantic Indexes get states and (simulated) background indexing. Admins can activate a ready Semantic Index for semantic search.

  • States: not_indexed → indexing → ready / failed. Admins can start indexing from the row menu: "Start indexing", "Retry indexing" after a failure, or "Re-index" when ready. The list refreshes once indexing ends, without a reload.
  • Locked parameters: once indexing has started, the model, context length and dimensions can't change. Title and description stay editable.
  • Activation: the semantic search binding references the active Semantic Index. The active one is shown highlighted above the list. Only ready indexes can be activated, and the active one can't be deleted. Without an active index, an empty state asks to create one or pick one from the list.

The indexing job is simulated. Real embedding comes in a follow-up.

Screenshots

Screenshot 2026-10-16 at 00 44 39 Screenshot 2026-10-16 at 00 33 07

What approach did you choose and why?

  • State machine: a string-backed enum with explicit transition methods (start_indexing!, finish_indexing!, fail_indexing!). Each transition runs under a row lock and raises on an invalid transition. Statesman might be another alternative from the codebase, but this approach was more common

  • Background processing: Llm::BuildSemanticIndexJob (GoodJob) stands in for the real indexing and randomly succeeds or fails. this is a placeholder for the logic already on the target branch A!-163

  • Activation: LlmFeatureBinding has a semantic_index reference, so there is exactly one active index per feature. ActivateService switches it, and contracts guard the ready-only and no-delete-while-active rules.

  • Locking: the update contract rejects parameter changes once the index has left not_indexed, and the form disables those fields and shows a banner.

The commits are meant to be reviewed one by one.

AI involvement

None/Assisted – No AI assistance used OR only autocomplete/pasted snippets. I effectively wrote and understand all the code.

@github-actions

Copy link
Copy Markdown

Caution

The provided work package version does not match the core version

Details:

Please make sure that:

  • The work package version OR your pull request target branch is correct

@xhr15
xhr15 force-pushed the implementation/ai-186-states-and-background-processing-for-semantic-indexes branch from 3e306fe to dc2ec18 Compare October 16, 2026 11:03
@joelpaulkoch
joelpaulkoch force-pushed the implementation/ai-178-crud-for-semantic-indexes branch from bc3cca3 to b960cfe Compare October 16, 2026 12:30
xhr15 and others added 6 commits October 16, 2026 14:36
Semantic Indexes move from not_indexed through indexing to ready or
failed. A placeholder job decides the outcome at random until the
real indexing is wired in.

https://community.openproject.org/wp/AI-186
Model, context length and dimensions stay editable only while a
Semantic Index has not been indexed. Name and description remain
editable in every state.
Only a ready Semantic Index can be activated, and the active one cannot
be deleted. Embedding and search still read the binding's model.
The active Semantic Index is pinned above the others in the semantic
search box, with an empty state while none is active. Ready indexes
can be activated after a confirmation.
@joelpaulkoch
joelpaulkoch force-pushed the implementation/ai-186-states-and-background-processing-for-semantic-indexes branch from dc2ec18 to 1c9d43b Compare October 16, 2026 13:20
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