The Internal Search Problem
Employees waste 20-30% of their time searching for information across systems. Odoo stores data in knowledge articles, documents, emails, tasks, and records, but native search requires knowing where to look and exact keywords. AI semantic search understands questions in natural language.
How AI Search Works
# AI Knowledge Search Architecture:
# 1. Index Odoo content:
# - Knowledge articles
# - Document attachments (PDF, DOCX)
# - Email threads
# - Project task descriptions
# - Wiki/help pages
# - Product documentation
# 2. Generate embeddings (vector representations)
# 3. Store in vector database
# 4. User asks question in natural language
# 5. AI finds relevant documents via similarity
# 6. LLM generates answer from found documents
# 7. Returns answer with source citationsIndexing Odoo Content
# Content sources to index:
# Knowledge articles:
articles = env['knowledge.article'].search([
('active', '=', True),
('is_published', '=', True),
])
for article in articles:
index_content(article.body, 'knowledge', article.id)
# Attachments (PDF/DOCX):
attachments = env['ir.attachment'].search([
('mimetype', 'in', ['application/pdf',
'application/vnd.openxmlformats-officedocument']),
])
for att in attachments:
text = extract_text(att.datas) # OCR or parser
index_content(text, 'attachment', att.id)
# Email threads (last 90 days):
messages = env['mail.message'].search([
('message_type', '=', 'email'),
('date', '>=', ninety_days_ago),
])Query Processing
# Natural language query examples:
# "What is our refund policy?"
# → Searches knowledge articles about refunds
# → Returns relevant policy with article link
# "How do I configure multi-warehouse?"
# → Finds internal documentation on warehouse setup
# → Summarizes steps with source references
# "What did the client say about the deadline?"
# → Searches email threads with client
# → Summarizes deadline-related communications
# "Show me the latest sales report template"
# → Finds PDF/DOCX attachments matching query
# → Returns document link and summaryRAG Implementation
# Retrieval-Augmented Generation (RAG):
# Step 1: Embed the question
query_embedding = embed(user_question)
# Step 2: Find similar documents
results = vector_db.similarity_search(
query_embedding, top_k=5
)
# Step 3: Generate answer with context
prompt = f"""
Answer the question based on the following internal documents.
Cite your sources.
Documents:
{format_results(results)}
Question: {user_question}
"""
answer = llm.generate(prompt)
# Step 4: Return with references
return {
'answer': answer,
'sources': [r.metadata for r in results],
'confidence': calculate_confidence(results),
}Odoo Chat Integration
# Add AI search to Odoo Discuss:
# @knowledge-bot what is the vacation policy?
# Livechat integration for customer-facing:
# Customer asks question
# AI searches public knowledge base
# Returns answer or escalates to human
# Helpdesk integration:
# Agent searching for solution
# AI suggests relevant KB articles
# Auto-links articles to ticketDeployMonkey AI
DeployMonkey's AI agent includes knowledge base search capabilities. Ask questions about your Odoo instance and get instant answers from your documentation and records.