Skip to content

feat(agents): select knowledge-base models - #12145

Draft
localai-org-maint-bot wants to merge 4 commits into
masterfrom
feat/agent-kb-models-11753
Draft

localai-org-maint-bot wants to merge 4 commits into
masterfrom
feat/agent-kb-models-11753

Conversation

@localai-org-maint-bot

Copy link
Copy Markdown
Collaborator

Description

Closes #11753.

Agents can select embedding and reranker models in Model Settings or through embedding_model and reranker_model in their configuration. Empty settings retain the pool embedding default and semantic-only search. Both standalone and distributed agents resolve settings within the owning user's namespace and check explicit selections against that user's model allowlist.

The shared runtime preserves embedding identities across restarts, rejects incompatible model changes until reset, and preserves document metadata when reranking. Documentation explains defaults, reindexing, and the restart needed after resetting collections with external sources. Optional OCR is deferred.

Notes for Reviewers

Depends on mudler/LocalAGI#499. This PR remains draft until that merges. go.mod temporarily pins its reviewed commit through the bot fork; replace that directive with the upstream version before merging.

Validation passed:

  • go test ./core/services/agents -count=1 -ginkgo.skip='AgentStore|runDueAgents'
  • go test ./core/services/agentpool -count=1 -ginkgo.focus='knowledge-base models'
  • LocalAGI collections/state tests against the same dependency graph.
  • React production build, ESLint (zero errors; eight pre-existing warnings), inline-style gate, and discovery/lint of the new Playwright regression.

Go regressions cover configuration serialization, metadata, user isolation, normalized names, upload/search model selection, dynamic reranking, and model permission failures. The Playwright test checks capability filtering and the saved payload. Browser execution and Docker-dependent suites could not run in this container. No coverage gates were changed.

Signed commits

  • Yes, I signed my commits.
  • Documentation updated (docs/content/) for user-facing changes, or not applicable

Assisted-by: Codex:GPT-6

Expose embedding and reranker model overrides in agent settings. Resolve
models per user and collection, retain the pool embedding default, and
check explicit selections against the owning user model allowlist.

Preserve original agent names for embedded lookups and resolve normalized
REST collection names only when they identify a single agent. Document
embedding resets and the restart requirement for external sources.

Assisted-by: Codex:GPT-6
Pin the pending LocalAGI dependency so reviewers can test the integration.
Add a UI regression for capability filtering and saved model selections.
Replace the fork pin after LocalAGI PR #499 merges.

Assisted-by: Codex:GPT-6
Explicitly discard errors stored by GORM and response write results in
mock handlers to satisfy errcheck.

Assisted-by: Codex:gpt-6
The save icon contributes to the button accessible name. Match the text
suffix so the knowledge-base selector test reaches the POST assertion.

Assisted-by: Codex:gpt-6
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.

Add Embedding, Reranker (and optional OCR) model fields to Agent configuration for building RAG pipelines at the agent level

1 participant