How apexive/odoo-llm works
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_provider.py LLM Core · mcp_controller.py MCP Controller · llm_tool.py Tool Framework · llm_chat_client_action.js Chat Interface
Components 28
LLM Foundation
- LLM Core
llm/models/llm_provider.py - Model Management
llm/models/llm_model.py
Odoo Chat
- Chat Interface
llm_thread/static/src/client_actions/llm_chat_client_action.js - Chat Store
llm_thread/static/src/services/llm_store_service.js - Chat Threads
llm_thread/models/llm_thread.py - AI Assistants
llm_assistant/models/llm_assistant.py - Prompt Templates
llm_assistant/models/llm_prompt.py - Argument Schema
llm_assistant/models/arguments_schema.py
Tools and MCP
- Tool Framework
llm_tool/models/llm_tool.py - Domain Tool Packs
llm_tool_account/models/account_tool_mixin.py - MCP Controller
llm_mcp_server/controllers/mcp_controller.py - MCP Dispatcher
llm_mcp_server/mcp_json_dispatcher.py - MCP Sessions
llm_mcp_server/models/llm_mcp_session.py
Knowledge RAG
- Knowledge Collections
llm_knowledge/models/llm_knowledge_collection.py - Resource Chunker
llm_knowledge/models/llm_resource_chunker.py - Vector Store
llm_store/models/llm_store.py - pgvector Store
llm_pgvector/models/llm_store_pgvector.py - Chroma Store
llm_chroma/models/llm_store_chroma.py - Knowledge Search Tool
llm_tool_knowledge/models/llm_tool_knowledge_retriever.py
Generation and Providers
- Generation Form
llm_generate/static/src/components/llm_media_form/llm_media_form.js - Generation Store Extension
llm_generate/static/src/patches/llm_store_service_patch.js - Generation Jobs
llm_generate_job/models/llm_generation_queue.py - OpenAI Provider
llm_openai/models/openai_provider.py - Anthropic Provider
llm_anthropic/models/anthropic_provider.py - Ollama Provider
llm_ollama/models/ollama_provider.py - Content Generation
llm_generate/models/llm_thread.py
Other components
- Odoo User
- MCP Client
Connections 29
- Odoo User → Chat Interface: uses chat
- Chat Interface → Chat Store: uses store
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
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
llm_mcp_server/controllers/mcp_controller.py - MCP Controller → MCP Sessions: manages sessions
llm_mcp_server/controllers/mcp_controller.py - MCP Controller → Tool Framework: executes tools
llm_mcp_server/controllers/mcp_controller.py - MCP Controller → LLM Core: uses LLM
- Knowledge Collections → Resource Chunker: chunks resources
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
llm_generate/static/src/components/llm_media_form/llm_media_form.js - Generation Store Extension → Chat Store: extends store
llm_generate/static/src/patches/llm_store_service_patch.js - Generation Store Extension → Content Generation: starts streaming
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