# apexive/odoo-llm architecture

> Architecture diagram of the GitHub repository apexive/odoo-llm, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/apexive/odoo-llm
- Repository: https://github.com/apexive/odoo-llm

## Overview

This Odoo add-on suite provides a shared LLM foundation, built-in chat and assistants, external MCP access, tool execution, retrieval-augmented knowledge, and content generation. Users chat through Odoo or connect an MCP client; assistant prompts and tools guide requests through the LLM layer to providers, while knowledge and generation supply additional capabilities. The README documents the high-level module relationships; sampled code confirms selected prompt-schema, chat-store, generation, knowledge, and MCP dispatch behavior. Unsampled integrations are represented only where the README describes them.

Main entry points: [`llm/models/llm_provider.py`](https://github.com/apexive/odoo-llm/blob/18.0/llm/models/llm_provider.py) (LLM Core), [`llm_mcp_server/controllers/mcp_controller.py`](https://github.com/apexive/odoo-llm/blob/18.0/llm_mcp_server/controllers/mcp_controller.py) (MCP Controller), [`llm_tool/models/llm_tool.py`](https://github.com/apexive/odoo-llm/blob/18.0/llm_tool/models/llm_tool.py) (Tool Framework), [`llm_thread/static/src/client_actions/llm_chat_client_action.js`](https://github.com/apexive/odoo-llm/blob/18.0/llm_thread/static/src/client_actions/llm_chat_client_action.js) (Chat Interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["LLM Foundation"]
  node_llm_core["LLM Core<br/>[llm_provider.py]"]
  node_model_management["Model Management<br/>[llm_model.py]"]
end

subgraph group_chat["Odoo Chat"]
  node_chat_ui["Chat Interface"]
  node_chat_store["Chat Store"]
  node_threads["Chat Threads<br/>[llm_thread.py]"]
  node_assistant["AI Assistants<br/>[llm_assistant.py]"]
  node_prompts["Prompt Templates<br/>[llm_prompt.py]"]
  node_argument_schema["Argument Schema"]
end

subgraph group_tools["Tools and MCP"]
  node_tool_framework["Tool Framework<br/>[llm_tool.py]"]
  node_domain_tools["Domain Tool Packs"]
  node_mcp_controller["MCP Controller<br/>[mcp_controller.py]"]
  node_mcp_dispatcher["MCP Dispatcher"]
  node_mcp_sessions["MCP Sessions<br/>[llm_mcp_session.py]"]
end

subgraph group_knowledge["Knowledge RAG"]
  node_knowledge["Knowledge Collections"]
  node_resource_chunker["Resource Chunker"]
  node_vector_store["Vector Store<br/>[llm_store.py]"]
  node_pgvector[("pgvector Store")]
  node_chroma[("Chroma Store")]
  node_knowledge_tools["Knowledge Search Tool"]
end

subgraph group_generation["Generation and Providers"]
  node_generation_ui["Generation Form<br/>[llm_media_form.js]"]
  node_generation_store["Generation Store Extension"]
  node_generation_jobs["Generation Jobs"]
  node_openai["OpenAI Provider<br/>[openai_provider.py]"]
  node_anthropic["Anthropic Provider"]
  node_ollama["Ollama Provider<br/>[ollama_provider.py]"]
  node_content_generation["Content Generation<br/>[llm_thread.py]"]
end

node_odoo_user(("Odoo User"))
node_mcp_client(("MCP Client"))

node_odoo_user -->|"uses chat"| node_chat_ui
node_chat_ui -->|"uses store"| node_chat_store
node_chat_store -.->|"loads conversations"| node_threads
node_chat_ui -.->|"selects assistant"| node_assistant
node_assistant -.->|"uses prompts"| node_prompts
node_prompts -->|"validates schema"| node_argument_schema
node_assistant -->|"uses LLM"| node_llm_core
node_llm_core -->|"manages models"| node_model_management
node_llm_core -->|"invokes tools"| node_tool_framework
node_tool_framework -->|"provides tool packs"| node_domain_tools
node_tool_framework -->|"provides tool packs"| node_knowledge_tools
node_mcp_client -->|"sends MCP"| node_mcp_controller
node_mcp_controller -->|"dispatches request"| node_mcp_dispatcher
node_mcp_controller -->|"manages sessions"| node_mcp_sessions
node_mcp_controller -->|"executes tools"| node_tool_framework
node_mcp_controller -->|"uses LLM"| node_llm_core
node_knowledge -->|"chunks resources"| node_resource_chunker
node_knowledge -->|"stores vectors"| node_vector_store
node_vector_store -->|"supports backend"| node_pgvector
node_vector_store -->|"supports backend"| node_chroma
node_knowledge_tools -.->|"searches knowledge"| node_knowledge
node_generation_ui -->|"submits request"| node_generation_store
node_generation_store -->|"extends store"| node_chat_store
node_generation_store -->|"starts streaming"| node_content_generation
node_llm_core -->|"supports provider"| node_openai
node_llm_core -->|"supports provider"| node_anthropic
node_llm_core -->|"supports provider"| node_ollama
node_model_management -->|"generates content"| node_content_generation
node_content_generation -.->|"queues work"| node_generation_jobs

click node_llm_core "https://github.com/apexive/odoo-llm/blob/18.0/llm/models/llm_provider.py"
click node_model_management "https://github.com/apexive/odoo-llm/blob/18.0/llm/models/llm_model.py"
click node_chat_ui "https://github.com/apexive/odoo-llm/blob/18.0/llm_thread/static/src/client_actions/llm_chat_client_action.js"
click node_chat_store "https://github.com/apexive/odoo-llm/blob/18.0/llm_thread/static/src/services/llm_store_service.js"
click node_threads "https://github.com/apexive/odoo-llm/blob/18.0/llm_thread/models/llm_thread.py"
click node_assistant "https://github.com/apexive/odoo-llm/blob/18.0/llm_assistant/models/llm_assistant.py"
click node_prompts "https://github.com/apexive/odoo-llm/blob/18.0/llm_assistant/models/llm_prompt.py"
click node_argument_schema "https://github.com/apexive/odoo-llm/blob/18.0/llm_assistant/models/arguments_schema.py"
click node_tool_framework "https://github.com/apexive/odoo-llm/blob/18.0/llm_tool/models/llm_tool.py"
click node_domain_tools "https://github.com/apexive/odoo-llm/blob/18.0/llm_tool_account/models/account_tool_mixin.py"
click node_mcp_controller "https://github.com/apexive/odoo-llm/blob/18.0/llm_mcp_server/controllers/mcp_controller.py"
click node_mcp_dispatcher "https://github.com/apexive/odoo-llm/blob/18.0/llm_mcp_server/mcp_json_dispatcher.py"
click node_mcp_sessions "https://github.com/apexive/odoo-llm/blob/18.0/llm_mcp_server/models/llm_mcp_session.py"
click node_knowledge "https://github.com/apexive/odoo-llm/blob/18.0/llm_knowledge/models/llm_knowledge_collection.py"
click node_resource_chunker "https://github.com/apexive/odoo-llm/blob/18.0/llm_knowledge/models/llm_resource_chunker.py"
click node_vector_store "https://github.com/apexive/odoo-llm/blob/18.0/llm_store/models/llm_store.py"
click node_pgvector "https://github.com/apexive/odoo-llm/blob/18.0/llm_pgvector/models/llm_store_pgvector.py"
click node_chroma "https://github.com/apexive/odoo-llm/blob/18.0/llm_chroma/models/llm_store_chroma.py"
click node_knowledge_tools "https://github.com/apexive/odoo-llm/blob/18.0/llm_tool_knowledge/models/llm_tool_knowledge_retriever.py"
click node_generation_ui "https://github.com/apexive/odoo-llm/blob/18.0/llm_generate/static/src/components/llm_media_form/llm_media_form.js"
click node_generation_store "https://github.com/apexive/odoo-llm/blob/18.0/llm_generate/static/src/patches/llm_store_service_patch.js"
click node_generation_jobs "https://github.com/apexive/odoo-llm/blob/18.0/llm_generate_job/models/llm_generation_queue.py"
click node_openai "https://github.com/apexive/odoo-llm/blob/18.0/llm_openai/models/openai_provider.py"
click node_anthropic "https://github.com/apexive/odoo-llm/blob/18.0/llm_anthropic/models/anthropic_provider.py"
click node_ollama "https://github.com/apexive/odoo-llm/blob/18.0/llm_ollama/models/ollama_provider.py"
click node_content_generation "https://github.com/apexive/odoo-llm/blob/18.0/llm_generate/models/llm_thread.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_llm_core,node_model_management,node_odoo_user,node_mcp_client toneBlue
class node_chat_ui,node_chat_store,node_threads,node_assistant,node_prompts,node_argument_schema toneAmber
class node_tool_framework,node_domain_tools,node_mcp_controller,node_mcp_dispatcher,node_mcp_sessions toneMint
class node_knowledge,node_resource_chunker,node_vector_store,node_pgvector,node_chroma,node_knowledge_tools toneRose
class node_generation_ui,node_generation_store,node_generation_jobs,node_openai,node_anthropic,node_ollama,node_content_generation toneIndigo
```

## Components

### LLM Foundation

- [LLM Core](https://github.com/apexive/odoo-llm/blob/18.0/llm/models/llm_provider.py): `llm/models/llm_provider.py`
- [Model Management](https://github.com/apexive/odoo-llm/blob/18.0/llm/models/llm_model.py): `llm/models/llm_model.py`

### Odoo Chat

- [Chat Interface](https://github.com/apexive/odoo-llm/blob/18.0/llm_thread/static/src/client_actions/llm_chat_client_action.js): `llm_thread/static/src/client_actions/llm_chat_client_action.js`
- [Chat Store](https://github.com/apexive/odoo-llm/blob/18.0/llm_thread/static/src/services/llm_store_service.js): `llm_thread/static/src/services/llm_store_service.js`
- [Chat Threads](https://github.com/apexive/odoo-llm/blob/18.0/llm_thread/models/llm_thread.py): `llm_thread/models/llm_thread.py`
- [AI Assistants](https://github.com/apexive/odoo-llm/blob/18.0/llm_assistant/models/llm_assistant.py): `llm_assistant/models/llm_assistant.py`
- [Prompt Templates](https://github.com/apexive/odoo-llm/blob/18.0/llm_assistant/models/llm_prompt.py): `llm_assistant/models/llm_prompt.py`
- [Argument Schema](https://github.com/apexive/odoo-llm/blob/18.0/llm_assistant/models/arguments_schema.py): `llm_assistant/models/arguments_schema.py`

### Tools and MCP

- [Tool Framework](https://github.com/apexive/odoo-llm/blob/18.0/llm_tool/models/llm_tool.py): `llm_tool/models/llm_tool.py`
- [Domain Tool Packs](https://github.com/apexive/odoo-llm/blob/18.0/llm_tool_account/models/account_tool_mixin.py): `llm_tool_account/models/account_tool_mixin.py`
- [MCP Controller](https://github.com/apexive/odoo-llm/blob/18.0/llm_mcp_server/controllers/mcp_controller.py): `llm_mcp_server/controllers/mcp_controller.py`
- [MCP Dispatcher](https://github.com/apexive/odoo-llm/blob/18.0/llm_mcp_server/mcp_json_dispatcher.py): `llm_mcp_server/mcp_json_dispatcher.py`
- [MCP Sessions](https://github.com/apexive/odoo-llm/blob/18.0/llm_mcp_server/models/llm_mcp_session.py): `llm_mcp_server/models/llm_mcp_session.py`

### Knowledge RAG

- [Knowledge Collections](https://github.com/apexive/odoo-llm/blob/18.0/llm_knowledge/models/llm_knowledge_collection.py): `llm_knowledge/models/llm_knowledge_collection.py`
- [Resource Chunker](https://github.com/apexive/odoo-llm/blob/18.0/llm_knowledge/models/llm_resource_chunker.py): `llm_knowledge/models/llm_resource_chunker.py`
- [Vector Store](https://github.com/apexive/odoo-llm/blob/18.0/llm_store/models/llm_store.py): `llm_store/models/llm_store.py`
- [pgvector Store](https://github.com/apexive/odoo-llm/blob/18.0/llm_pgvector/models/llm_store_pgvector.py): `llm_pgvector/models/llm_store_pgvector.py`
- [Chroma Store](https://github.com/apexive/odoo-llm/blob/18.0/llm_chroma/models/llm_store_chroma.py): `llm_chroma/models/llm_store_chroma.py`
- [Knowledge Search Tool](https://github.com/apexive/odoo-llm/blob/18.0/llm_tool_knowledge/models/llm_tool_knowledge_retriever.py): `llm_tool_knowledge/models/llm_tool_knowledge_retriever.py`

### Generation and Providers

- [Generation Form](https://github.com/apexive/odoo-llm/blob/18.0/llm_generate/static/src/components/llm_media_form/llm_media_form.js): `llm_generate/static/src/components/llm_media_form/llm_media_form.js`
- [Generation Store Extension](https://github.com/apexive/odoo-llm/blob/18.0/llm_generate/static/src/patches/llm_store_service_patch.js): `llm_generate/static/src/patches/llm_store_service_patch.js`
- [Generation Jobs](https://github.com/apexive/odoo-llm/blob/18.0/llm_generate_job/models/llm_generation_queue.py): `llm_generate_job/models/llm_generation_queue.py`
- [OpenAI Provider](https://github.com/apexive/odoo-llm/blob/18.0/llm_openai/models/openai_provider.py): `llm_openai/models/openai_provider.py`
- [Anthropic Provider](https://github.com/apexive/odoo-llm/blob/18.0/llm_anthropic/models/anthropic_provider.py): `llm_anthropic/models/anthropic_provider.py`
- [Ollama Provider](https://github.com/apexive/odoo-llm/blob/18.0/llm_ollama/models/ollama_provider.py): `llm_ollama/models/ollama_provider.py`
- [Content Generation](https://github.com/apexive/odoo-llm/blob/18.0/llm_generate/models/llm_thread.py): `llm_generate/models/llm_thread.py`

### Other components

- **Odoo User**
- **MCP Client**

## Connections

- Odoo User → Chat Interface: uses chat
- Chat Interface → Chat Store: uses store (evidence: `llm_thread/static/src/client_actions/llm_chat_client_action.js`)
- Chat Store → Chat Threads: loads conversations
- Chat Interface → AI Assistants: selects assistant
- AI Assistants → Prompt Templates: uses prompts
- Prompt Templates → Argument Schema: validates schema (evidence: `llm_assistant/models/llm_prompt.py`)
- AI Assistants → LLM Core: uses LLM
- LLM Core → Model Management: manages models
- LLM Core → Tool Framework: invokes tools
- Tool Framework → Domain Tool Packs: provides tool packs
- Tool Framework → Knowledge Search Tool: provides tool packs
- MCP Client → MCP Controller: sends MCP
- MCP Controller → MCP Dispatcher: dispatches request (evidence: `llm_mcp_server/controllers/mcp_controller.py`)
- MCP Controller → MCP Sessions: manages sessions (evidence: `llm_mcp_server/controllers/mcp_controller.py`)
- MCP Controller → Tool Framework: executes tools (evidence: `llm_mcp_server/controllers/mcp_controller.py`)
- MCP Controller → LLM Core: uses LLM
- Knowledge Collections → Resource Chunker: chunks resources (evidence: `llm_knowledge/models/llm_knowledge_collection.py`)
- Knowledge Collections → Vector Store: stores vectors
- Vector Store → pgvector Store: supports backend
- Vector Store → Chroma Store: supports backend
- Knowledge Search Tool → Knowledge Collections: searches knowledge
- Generation Form → Generation Store Extension: submits request (evidence: `llm_generate/static/src/components/llm_media_form/llm_media_form.js`)
- Generation Store Extension → Chat Store: extends store (evidence: `llm_generate/static/src/patches/llm_store_service_patch.js`)
- Generation Store Extension → Content Generation: starts streaming (evidence: `llm_generate/static/src/patches/llm_store_service_patch.js`)
- LLM Core → OpenAI Provider: supports provider
- LLM Core → Anthropic Provider: supports provider
- LLM Core → Ollama Provider: supports provider
- Model Management → Content Generation: generates content
- Content Generation → Generation Jobs: queues work
