LLM Tool Knowledge
Give your AI assistants instant access to your knowledge base with semantic search and source citation capabilities.
Module Type: 🔌 Extension (RAG Tool)
Architecture
┌───────────────────────────────────────────────────────────────┐
│ AI Consumers │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
│ │llm_assistant│ │ llm_letta │ │ llm_mcp_server │ │
│ └──────┬──────┘ └──────┬──────┘ └──────────┬──────────┘ │
└─────────┼────────────────┼────────────────────┼──────────────┘
└────────────────┼────────────────────┘
▼
┌───────────────────────────────────────────┐
│ ★ llm_tool_knowledge (This Module) ★ │
│ Knowledge Retriever Tool │
│ 🔍 Semantic Search │ 📚 Source Citations │
└─────────────────────┬─────────────────────┘
│
┌───────────┴───────────┐
▼ ▼
┌───────────────────────────┐ ┌───────────────────────────┐
│ llm_tool │ │ llm_knowledge │
│ (Tool Framework) │ │ (RAG Pipeline) │
└───────────────────────────┘ └───────────────────────────┘
Installation
What to Install
For RAG tool access:
odoo-bin -d your_db -i llm_tool_knowledge
Auto-Installed Dependencies
llm(core infrastructure)llm_tool(tool framework)llm_knowledge(RAG infrastructure)llm_assistant(AI assistant framework)
Why Use This Module?
| Feature | llm_tool_knowledge |
|---|---|
| Search | 🔍 Semantic similarity search |
| Citations | 📚 Source document references |
| Hybrid | 🔄 Semantic + keyword search |
| Dual Use | 🤖 Odoo assistants + MCP clients |
Common Setups
| I want to... | Install |
|---|---|
| Chat + RAG | llm_assistant + llm_openai + llm_tool_knowledge + llm_pgvector |
| Claude + RAG | llm_mcp_server + llm_tool_knowledge + llm_pgvector |
This module provides RAG (Retrieval-Augmented Generation) tools that enable AI assistants to search documents, cite sources, and answer questions using your actual company data instead of just their training.
Overview
LLM Tool Knowledge extends the Odoo LLM ecosystem with a powerful knowledge_retriever tool that performs semantic search across your knowledge collections. This tool can be used in two ways:
- With Odoo AI Assistants (
llm_assistantmodule) - Enable your internal Odoo chatbots to search company knowledge - With External MCP Clients (
llm_mcp_servermodule) - Expose your knowledge base to external AI tools like Claude Desktop, Continue.dev, and other MCP-compatible applications
Features
Knowledge Retriever Tool
- Semantic Search: Find relevant documents using natural language queries
- Source Citations: AI responses include references to source documents
- Hybrid Search: Combine semantic and keyword search for better accuracy
- Collection-Aware: Search specific collections or across all knowledge
- Configurable Relevance: Set minimum similarity thresholds
Dual Integration
1. Odoo AI Assistants (llm_assistant)
When enabled on an assistant, the AI can automatically search your knowledge base:
User: "What's our refund policy?"
AI: Uses knowledge_retriever tool → searches policy documents → cites sources
2. External MCP Clients (llm_mcp_server)
Expose the knowledge_retriever tool via Model Context Protocol:
Claude Desktop → MCP Server (Odoo) → knowledge_retriever → returns relevant docs
External AI tools can search your Odoo knowledge base securely.
Installation
-
Install dependencies:
llm_knowledgemodule (required)llm_toolmodule (required)llm_assistantmodule (required)llm_mcp_servermodule (optional - for external MCP clients)
-
Install this module:
# Via Odoo Apps interface Apps → Search "LLM Tool Knowledge" → Install -
The tool is automatically registered and ready to use.
Configuration
For Odoo AI Assistants
- Go to LLM → Assistants → Assistants
- Open or create an assistant
- Navigate to the Tools tab
- Enable the "knowledge_retriever" tool
- The assistant can now search knowledge collections
For External MCP Clients
- Install and configure
llm_mcp_servermodule - The
knowledge_retrievertool is automatically exposed via MCP - Configure your MCP client (Claude Desktop, etc.) to connect to Odoo
- External AI can now search your knowledge base
Usage Examples
Example 1: Odoo Assistant with Knowledge Access
Setup:
- Create knowledge collection with company policies
- Enable knowledge_retriever tool on support assistant
Result:
User: "What's the warranty period for laptops?"
Assistant: [Searches policies collection]
"Based on our Electronics Warranty Policy, laptops have a 2-year warranty covering
hardware defects. (Source: Electronics Warranty Policy, updated Jan 2024)"
Example 2: Claude Desktop Accessing Odoo Knowledge
Setup:
- Configure llm_mcp_server with your Odoo instance
- Add server to Claude Desktop MCP settings
- Index product documentation in Odoo knowledge
Result:
Claude Desktop → uses knowledge_retriever tool → searches Odoo docs
Returns: Relevant product specs with source citations from your knowledge base
Example 3: Continue.dev with Company Codebase
Setup:
- Index code documentation in Odoo knowledge collection
- Expose via MCP server
- Configure Continue.dev to use Odoo MCP server
Result: Developer asks Continue.dev about internal APIs → searches indexed docs → provides accurate answers from your actual documentation.
How It Works
Tool Input Schema
{
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "Search query to find relevant knowledge"
},
"collection_id": {
"type": "string",
"description": "ID of knowledge collection to search (optional)"
},
"top_k": {
"type": "integer",
"description": "Number of results to return (default: 5)"
},
"min_similarity": {
"type": "number",
"description": "Minimum similarity score 0-1 (default: 0.7)"
}
},
"required": ["query"]
}
Tool Execution Flow
- Receive query: AI assistant or external tool calls knowledge_retriever
- Vector search: Query is embedded and searched against knowledge chunks
- Filter results: Apply similarity threshold and top_k limit
- Return sources: Chunks with metadata, similarity scores, and source references
- AI uses context: Assistant incorporates results into response with citations
Technical Details
Tool Registration
Defined in data/llm_tool_data.xml:
<record id="llm_tool_knowledge_retriever" model="llm.tool">
<field name="name">knowledge_retriever</field>
<field
name="description"
>Retrieves relevant knowledge from document database
using semantic search...</field>
<field name="implementation">knowledge_retriever</field>
<field name="active" eval="True" />
</record>
Implementation
Located in models/llm_tool_knowledge_retriever.py:
class LLMToolKnowledgeRetriever(models.Model):
_inherit = "llm.tool"
@api.model
def _get_available_implementations(self):
implementations = super()._get_available_implementations()
return implementations + [("knowledge_retriever", "Knowledge Retriever")]
Search Process
- Embed query using collection's embedding model
- Perform vector similarity search in vector store (pgvector/Qdrant/Chroma)
- Filter by min_similarity threshold
- Return top_k most relevant chunks
- Include source document metadata
Use Cases
Internal Odoo Assistants
- Customer Support: Search FAQ, policies, product docs
- HR Assistant: Search employee handbook, HR policies
- Sales Assistant: Search product specs, pricing, competitor analysis
- IT Helpdesk: Search technical documentation, troubleshooting guides
External MCP Integration
- Developer Tools: Continue.dev, Cursor accessing code documentation
- Claude Desktop: Personal assistant with access to company knowledge
- Custom AI Apps: Build external apps that query Odoo knowledge
- Multi-Tool Workflows: Chain knowledge search with other MCP tools
Security
Access Control
- Tool: Requires
llm.group_llm_userto execute - Collections: Respects Odoo record rules and access rights
- MCP Server: Separate authentication for external access
Data Privacy
- Knowledge searches respect user permissions
- External MCP access requires explicit configuration
- No knowledge is shared unless explicitly indexed in collections
Best Practices
- Organize Collections: Create topic-specific collections for better search accuracy
- Update Regularly: Keep knowledge collections current with latest information
- Set Thresholds: Adjust min_similarity based on precision/recall needs
- Limit Scope: Use collection_id parameter to search specific domains
- Monitor Usage: Track which queries are most common to improve indexing
Troubleshooting
Tool not appearing
- Verify module is installed and active
- Check llm_knowledge module is installed
- Refresh assistants or MCP client
Search returns no results
- Check collection has processed resources (state=ready)
- Verify embeddings are generated
- Lower min_similarity threshold
- Check vector store is configured correctly
MCP connection fails
- Verify llm_mcp_server is installed and configured
- Check MCP client configuration matches Odoo URL
- Review authentication credentials
- Check Odoo is accessible from MCP client network
Requirements
- Odoo: 18.0+
- Python: 3.11+
- Dependencies:
llm_knowledgemodule (semantic search, vector storage)llm_toolmodule (tool framework)llm_assistantmodule (AI assistants)llm_mcp_servermodule (optional - for external MCP clients)
License
LGPL-3
Author
Apexive Solutions LLC
- Website: https://github.com/apexive/odoo-llm
- Email: info@apexive.com
Contributing
Issues and pull requests welcome at https://github.com/apexive/odoo-llm