Skip to content

[19.0][WIP] AI Agent Integration Framework for Odoo (Native LLM/vllm OpenAI API compatible) - #61

Draft
petrus-v wants to merge 9 commits into
OCA:19.0from
petrus-v:19.0-incubation
Draft

[19.0][WIP] AI Agent Integration Framework for Odoo (Native LLM/vllm OpenAI API compatible)#61
petrus-v wants to merge 9 commits into
OCA:19.0from
petrus-v:19.0-incubation

Conversation

@petrus-v

@petrus-v petrus-v commented Feb 26, 2026

Copy link
Copy Markdown

Note

Side-Project & Incubating MVP
This project is developed on my spare time as an exploratory, incubating MVP to experiment with agentic AI natively embedded into Odoo ERP. Feedback, architecture ideas, and community discussions are warmly welcome in #73! ☕


🎯 Goal & Architecture Vision

This PR introduces the foundational framework for a modular, multi-agent AI system natively integrated within Odoo. Rather than treating AI as an external iframe or standalone chatbot, this framework leverages Odoo’s core architectural strengths:

  • Chatter & Discussions: Native AI Thread tab directly on business records.
  • Strict Security & ACLs: Every AI Agent is intrinsically modeled around an Odoo user (res.users), strictly respecting native Access Control Lists (ir.model.access) and record rules (ir.rule).
  • Asynchronous & Scalable: Delegating heavy LLM reasoning and tool executions to queue_job workers without freezing UI or blocking worker processes.
  • Real-Time UI Feedback: Real-time WebSocket updates via Odoo's bus.bus and a dedicated global Systray task tracker.
  • OCA Standard Compliance: Built as clean, decoupled addons on top of OCA standards (e.g. ai_tool).

🗺️ Roadmap & Current Progress

✅ Phase 1: Core Chatter Integration & UI — DONE

  • ai_oca_native_llm: Extensible client wrapper for local (Ollama/vLLM) and remote OpenAI-compatible endpoints.
  • ai_oca_native_thread: Data models (ai.thread, ai.message) contextualized per record and user. Integrated OWL tab inside the standard Odoo Chatter.
Capture.video.du.2026-02-26.08-41-54.mp4

✅ Phase 2: Asynchronous Execution & Real-Time Bus — DONE

  • Offloaded assistant reasoning to background queue_job tasks (_action_extract_intent).
  • Real-time UI updates via bus.bus WebSockets without page reload.
  • Status management (processing, done, cancel).

✅ Phase 2.1: Global Systray Task Tracker — DONE

  • ai_oca_native_thread_systray: Top navbar dropdown tracking active/pending background AI tasks for the logged-in user with live counter badge and direct navigation.

✅ Phase 3: Modular Orchestrator & Personas — DONE

  • ai_oca_native_orchestrator: Decoupled orchestration logic from chat threads.
  • ai.persona & ai.prompt.template: Configurable system prompts, wrappers, and agent personas.
  • Structured sub-task storage via ai.task.thread and ai.task.message.

✅ Phase 3.1: Autonomous Agents & Base Tool Engine — DONE

  • ai_oca_native_agent: Persona domains (ai.agent), res.users binding (is_ai_agent), and execution modes (user_context vs dedicated_agent).
  • ai_oca_native_agent_tool: Integration bridge linking agents to OCA ai.tool registry.
  • 100% unit test coverage across all modules.

🟡 Phase 3.1.1: Tool Calling Loop & Action Plan Proposal — IN PROGRESS

  • Native function/tool calling support in ai.llm.client (OpenAI format tools / tool_calls).
  • Conversational ReAct loop in ai_oca_native_orchestrator.
  • Discovery tools (agent_list_available_tools, agent_list_available_agents).
  • Structured action plan generation validated with Pydantic (ActionPlanPayload & ActionStep, status awaiting_approval).

🚀 Phase 3.1.2: Sub-Agent Delegation & Async Plan Engine — READY

  • Direct agent delegation tool (agent_delegate_task) with isolated, audit-friendly ai.task.thread.
  • Non-blocking asynchronous DAG plan runner via queue_job (resolving dependencies depends_on, parallel steps, zero busy-waiting workers).
  • Isolated error capture and Python traceback storage in task messages.
  • Orchestrator completion callback / synthesis job.

💡 Phase 3.2: Human-In-The-Loop Approval UI — BACKLOG

  • Interactive OWL buttons ("Validate Plan 🚀" / "Cancel") on proposed plans in Chatter and Systray.
  • Triggers the async plan engine (Phase 3.1.6) upon explicit human approval.

💡 Phase 4+: Self-Evolution & Tool Retrieval (RAG) — BACKLOG

  • In-chatter feedback loops (inspired by DSPy / Hermes).
  • Dynamic tool vectorization / pgvector indexing (ai.tool auto-discovery on module update).

@angelmoya

Copy link
Copy Markdown
Member

Hi! Thank you very much for the initiative with this module.

To ensure this solution fits the long-term strategy for this repository, here is the Roadmap Issue: #73

Please have a look when you can. It would be ideal to review the open points there to align the design of this PR, avoid duplicating efforts, and make sure we are all on the same page.

Let us know what you think!

@petrus-v petrus-v changed the title [19.0][WIP] AI Agent Integration Framework for Odoo (Native LLM/Ollama) [19.0][WIP] AI Agent Integration Framework for Odoo (Native LLM/vllm OpenAI API compatible) Aug 30, 2026
@OCA-git-bot OCA-git-bot added series:19.0 mod:ai_oca_native_agent Module ai_oca_native_agent mod:ai_tool_sale_crm Module ai_tool_sale_crm mod:ai_oca_native_thread_systray Module ai_oca_native_thread_systray mod:ai_oca_native_llm Module ai_oca_native_llm mod:ai_oca_native_thread Module ai_oca_native_thread mod:ai_oca_native_agent_tool Module ai_oca_native_agent_tool mod:ai_agent_salesman Module ai_agent_salesman mod:ai_oca_native_orchestrator Module ai_oca_native_orchestrator mod:ai_oca_native_base Module ai_oca_native_base labels Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:ai_agent_salesman Module ai_agent_salesman mod:ai_oca_native_agent_tool Module ai_oca_native_agent_tool mod:ai_oca_native_agent Module ai_oca_native_agent mod:ai_oca_native_base Module ai_oca_native_base mod:ai_oca_native_llm Module ai_oca_native_llm mod:ai_oca_native_orchestrator Module ai_oca_native_orchestrator mod:ai_oca_native_thread_systray Module ai_oca_native_thread_systray mod:ai_oca_native_thread Module ai_oca_native_thread mod:ai_tool_sale_crm Module ai_tool_sale_crm series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants