Skip to content

[ADD] ai_oca_bridge_openwebui - #136

Open
seblveb wants to merge 17 commits into
OCA:18.0from
Semper-Connect:18.0-add-ai-oca-bridge-openwebui
Open

seblveb wants to merge 17 commits into
OCA:18.0from
Semper-Connect:18.0-add-ai-oca-bridge-openwebui

Conversation

@seblveb

@seblveb seblveb commented Oct 21, 2026

Copy link
Copy Markdown

Description

This pull request adds ai_oca_bridge_openwebui, an integration module
between Odoo Discuss and OpenWebUI.

The module extends ai_oca_bridge and ai_oca_bridge_chatter and uses the
OpenWebUI OpenAI-compatible chat completions API.

Architecture

The integration keeps responsibilities separated:

  • Odoo manages users, access rights, Discuss channels and conversation
    history.
  • OpenWebUI manages AI models, prompts, knowledge bases, RAG, agents and
    external tools.

The optional system prompt configured on the bridge provides additional local
Odoo context. The main AI configuration remains in OpenWebUI.

The synchronized models and tools are only a local Odoo catalog used for
configuration and selection. OpenWebUI remains the source of truth for their
behavior.

Features

  • OpenWebUI chat completion bridge for Odoo Discuss
  • Configurable model identifier
  • Optional bridge-level system prompt
  • Configurable conversation history size
  • Configurable timeout
  • OpenWebUI model synchronization
  • OpenWebUI tool synchronization
  • Optional tool selection
  • Assistant responses posted by the configured Odoo AI user
  • Error handling for failed and empty responses

Dependencies

  • ai_oca_bridge
  • ai_oca_bridge_chatter

Testing

The module has been tested on Odoo 18 with the OCA ai repository.

@oca-cla-bot

oca-cla-bot Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@OCA-git-bot OCA-git-bot added series:18.0 mod:ai_oca_bridge_openwebui Module ai_oca_bridge_openwebui labels Oct 21, 2026
Allow synchronizing OpenWebUI models before selecting one.

Do not require openwebui_model during bridge configuration because the
OpenWebUI catalog must be synchronized first. Validate the model only when
the bridge is executed.

Keep model_id as the generic OCA ir.model target and use OpenWebUI legacy
function calling so OpenWebUI executes the configured workspace/MCP tools
server-side and returns the final answer to Discuss.

Do not use native function calling or tool_choice without a chat context,
as OpenWebUI would return raw tool_calls to Odoo instead of a final answer.
@seblveb

seblveb commented Oct 24, 2026

Copy link
Copy Markdown
Author

All checks are green, including Odoo, OCB, pre-commit, Codecov and Runboat.

The PR is ready for maintainer review and merge.

Possible follow-up improvements are already being considered, especially around transparency and data control when using external models. These improvements could provide configurable options to:

  • inspect the context, records and data selected before sending them to an external model;
  • make the transmitted data visible to the user;
  • optionally export the consulted data as an attachment;
  • optionally include a link to the OpenWebUI conversation created for the request;
  • clearly distinguish between data processed locally by Odoo and data transmitted to OpenWebUI or another external model.

These options should be explicit, permission-aware and disabled by default where appropriate. They would likely be implemented in a follow-up change so that the current PR remains focused on the initial OpenWebUI bridge.

Enable the OpenWebUI server-side agentic flow from Odoo Discuss.

The bridge now supports web search through OpenWebUI, keeps the original
user question visible, uses the Odoo Discuss channel as the conversation
title, and optionally retains the OpenWebUI conversation for later review.

The retained conversation can expose the assistant response, web-search
activity, sources and provider-specific reasoning output when supported by
the selected OpenWebUI model and permissions.

Also update the bridge configuration, README documentation and automated
tests for the new agentic flow.
@seblveb

seblveb commented Oct 28, 2026

Copy link
Copy Markdown
Author

Update — agentic web search and retained OpenWebUI conversations

The existing implementation has been updated and pushed to the same branch.

Added behavior

  • Web search can be enabled directly on the Odoo bridge.
  • The bridge uses OpenWebUI's server-side agentic flow.
  • The Odoo Discuss channel name is used as the OpenWebUI conversation title.
  • The original Odoo user question is preserved in OpenWebUI.
  • The request uses streaming with chat_id, assistant id and session_id.
  • OpenWebUI performs the server-side tool loop and web search.
  • The final response is retrieved from OpenWebUI and posted back to Odoo Discuss.
  • The conversation can be retained for review by the OpenWebUI user.
  • Retained conversations can expose the question, answer, web-search activity,
    sources and provider-specific reasoning output when supported by OpenWebUI.
  • Internal Odoo references such as /odoo/res.partner/<id> are treated as
    internal context and not as sources.

Documentation

The README now documents:

  • OpenWebUI API-key permissions;
  • web-search prerequisites;
  • the Odoo AI user / OpenWebUI user association;
  • conversation retention;
  • source and reasoning visibility limitations.

Validation

  • Local functional test completed with Odoo Discuss and OpenWebUI.
  • Gérard successfully performed current web searches.
  • Odoo tests: 0 failed, 0 error(s).
  • Pre-commit hooks pass.

Commit pushed:

a510c0f feat: add agentic web search and retained OpenWebUI conversations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:ai_oca_bridge_openwebui Module ai_oca_bridge_openwebui series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants