Logo Ai Search Rag

Ai Search Rag

Tổ chức
Happy-Technologies-LLC
ai-search-rag

Configure retrieval-augmented AI search, including sources, indexing, ranking, answer generation, and search quality tuning.

Tổng quan

Nhà phát hànhHappy-Technologies-LLC
Kho mãhappy-platform-skills
Tên kỹ năngai-search-rag
Sao
41
Bản fork
14
Tệp đi kèm
Chỉ có hướng dẫn
Giấy phépApache-2.0
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Hướng dẫn có đủ mọi thứ cần thiết

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được Happy-Technologies-LLC công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Ai Search Rag trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/Happy-Technologies-LLC/happy-platform-skills/tree/main/skills/genai/ai-search-rag
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Happy-Technologies-LLC/happy-platform-skills.git /tmp/happy-platform-skills
mkdir -p .claude/skills
cp -r /tmp/happy-platform-skills/skills/genai/ai-search-rag .claude/skills/ai-search-rag
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Ai Search Rag trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Ai Search Rag ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Ai Search Rag với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

AI Search with RAG Configuration

Overview

This skill covers configuring and optimizing ServiceNow AI Search with Retrieval Augmented Generation (RAG):

  • Creating and configuring search sources (knowledge bases, catalog items, service portal content)
  • Setting up search profiles that define search behavior and source priorities
  • Configuring result ranking and relevance tuning for quality search results
  • Enabling RAG-based answer generation from retrieved knowledge content
  • Managing search indexes and field configurations for optimal retrieval
  • Tuning search quality through feedback loops and analytics
  • Integrating AI Search with Now Assist and Virtual Agent

When to use: When setting up AI-powered search across knowledge bases, configuring RAG for generative answers from enterprise content, or optimizing search result quality in ServiceNow.

Prerequisites

  • Roles: admin, search_admin, or now_assist_admin
  • Plugins: com.snc.ai_search (AI Search), com.snc.generative_ai_controller (Generative AI Controller), sn_gen_ai (Generative AI)
  • Access: sn_ai_search_source, sn_ai_search_profile, sn_gen_ai_config tables
  • Knowledge: Understanding of search concepts (indexing, ranking, relevance), knowledge management basics
  • Related Skills: genai/now-assist-qa for conversational AI, knowledge/article-generation for KB content

Procedure

Step 1: Assess Available Knowledge Sources

Identify what content should be searchable and available for RAG.

MCP Approach:

Use SN-Query-Table on kb_knowledge_base:
  - query: active=true
  - fields: sys_id,title,description,kb_version,active,article_count
  - limit: 20

Check existing knowledge articles:

Use SN-Query-Table on kb_knowledge:
  - query: workflow_state=published^kb_knowledge_base=<kb_sys_id>
  - fields: sys_id,short_description,kb_knowledge_base,workflow_state,sys_updated_on
  - limit: 20

REST Approach:

GET /api/now/table/kb_knowledge_base
  ?sysparm_query=active=true
  &sysparm_fields=sys_id,title,description,active
  &sysparm_limit=20

Step 2: Create Search Sources

Search sources define where AI Search retrieves content from.

Knowledge Base Search Source:

MCP Approach:

Use SN-Create-Record on sn_ai_search_source:
  - name: "IT Knowledge Base"
  - description: "Primary IT support knowledge articles"
  - source_type: "knowledge"
  - source_table: "kb_knowledge"
  - source_condition: "workflow_state=published^kb_knowledge_base=<kb_sys_id>"
  - active: true
  - enable_rag: true
  - rag_content_field: "text"
  - search_fields: "short_description,text,meta"
  - display_fields: "short_description,kb_category,sys_updated_on"

REST Approach:

POST /api/now/table/sn_ai_search_source
Body: {
  "name": "IT Knowledge Base",
  "description": "Primary IT support knowledge articles",
  "source_type": "knowledge",
  "source_table": "kb_knowledge",
  "source_condition": "workflow_state=published",
  "active": true,
  "enable_rag": true,
  "rag_content_field": "text"
}

Catalog Item Search Source:

Use SN-Create-Record on sn_ai_search_source:
  - name: "Service Catalog Items"
  - description: "Available service catalog offerings"
  - source_type: "catalog"
  - source_table: "sc_cat_item"
  - source_condition: "active=true^hide_sp=false"
  - active: true
  - enable_rag: false
  - search_fields: "name,short_description,description"
  - display_fields: "name,short_description,category"

Incident Solutions Search Source:

Use SN-Create-Record on sn_ai_search_source:
  - name: "Resolved Incidents"
  - description: "Previously resolved incidents for pattern matching"
  - source_type: "table"
  - source_table: "incident"
  - source_condition: "state=6^close_notes!=NULL^universal_requestISNOTEMPTY"
  - active: true
  - enable_rag: true
  - rag_content_field: "close_notes"
  - search_fields: "short_description,description,close_notes"

Step 3: Configure Search Profiles

Search profiles control which sources are searched and how results are ranked.

MCP Approach:

Use SN-Create-Record on sn_ai_search_profile:
  - name: "IT Support Search"
  - description: "Search profile for IT help desk agents and self-service"
  - active: true
  - default_profile: false
  - rag_enabled: true
  - max_results: 10
  - rag_max_sources: 5
  - rag_confidence_threshold: 0.7
  - search_sources: "<kb_source_sys_id>,<catalog_source_sys_id>,<incident_source_sys_id>"

REST Approach:

POST /api/now/table/sn_ai_search_profile
Body: {
  "name": "IT Support Search",
  "description": "Search profile for IT help desk agents and self-service",
  "active": true,
  "rag_enabled": true,
  "max_results": 10,
  "rag_max_sources": 5,
  "rag_confidence_threshold": 0.7
}

Step 4: Configure Search Field Weighting

Field configurations control how different fields contribute to relevance scoring.

MCP Approach:

Use SN-Create-Record on sn_ai_search_field_config:
  - search_source: "<kb_source_sys_id>"
  - field_name: "short_description"
  - boost_factor: 3.0
  - searchable: true
  - displayable: true
  - order: 100
Use SN-Create-Record on sn_ai_search_field_config:
  - search_source: "<kb_source_sys_id>"
  - field_name: "text"
  - boost_factor: 1.0
  - searchable: true
  - displayable: false
  - order: 200
Use SN-Create-Record on sn_ai_search_field_config:
  - search_source: "<kb_source_sys_id>"
  - field_name: "meta"
  - boost_factor: 2.0
  - searchable: true
  - displayable: false
  - order: 300

Boost factor guidelines:

Boost LevelValueUse Case
High3.0-5.0Title, short description -- primary match fields
Medium1.5-2.5Tags, metadata, categories -- supporting match fields
Standard1.0Body text, full content -- broad matching
Low0.5Comments, notes -- supplementary information

Step 5: Configure RAG Answer Generation

Set up the generative AI configuration for producing answers from retrieved content.

MCP Approach:

Use SN-Create-Record on sn_gen_ai_config:
  - name: "AI Search RAG Configuration"
  - description: "Controls how RAG generates answers from search results"
  - active: true
  - llm_provider: "now_llm"
  - model: "default"
  - temperature: 0.3
  - max_tokens: 500
  - system_prompt: "You are a helpful IT support assistant. Answer questions using only the provided context. If the context does not contain enough information, say so clearly. Always cite the source article."
  - context_window: 4000
  - enable_citations: true
  - citation_format: "inline"

REST Approach:

POST /api/now/table/sn_gen_ai_config
Body: {
  "name": "AI Search RAG Configuration",
  "description": "Controls how RAG generates answers from search results",
  "active": true,
  "llm_provider": "now_llm",
  "temperature": 0.3,
  "max_tokens": 500,
  "enable_citations": true
}

Temperature guidelines for RAG:

TemperatureBehaviorUse Case
0.0-0.2Very factual, deterministicPolicy lookups, compliance answers
0.3-0.5Balanced, mostly factualIT support, troubleshooting guidance
0.6-0.8More creative, varied phrasingContent suggestions, recommendations
0.9-1.0Highly creativeNot recommended for RAG

Step 6: Set Up Search Index Configuration

Control how content is indexed for optimal retrieval.

MCP Approach:

Use SN-Create-Record on sn_ai_search_index:
  - search_source: "<kb_source_sys_id>"
  - name: "KB Article Index"
  - index_type: "full_text"
  - active: true
  - rebuild_schedule: "daily"
  - chunk_size: 500
  - chunk_overlap: 50
  - embedding_model: "default"

REST Approach:

POST /api/now/table/sn_ai_search_index
Body: {
  "search_source": "<kb_source_sys_id>",
  "name": "KB Article Index",
  "index_type": "full_text",
  "active": true,
  "rebuild_schedule": "daily",
  "chunk_size": 500,
  "chunk_overlap": 50
}

Chunking strategy guidelines:

Content TypeChunk SizeOverlapRationale
Short KB articles300-50030-50Preserve complete article context
Long documentation500-80050-100Balance context with specificity
FAQ content200-30020-30Keep Q&A pairs together
Policy documents800-1200100-150Maintain section-level context

Step 7: Configure Result Ranking

MCP Approach:

Use SN-Create-Record on sn_ai_search_result_config:
  - search_profile: "<profile_sys_id>"
  - name: "IT Support Ranking"
  - ranking_model: "hybrid"
  - semantic_weight: 0.6
  - keyword_weight: 0.3
  - recency_weight: 0.1
  - personalization: true
  - active: true

Ranking model options:

ModelDescriptionBest For
keywordTraditional keyword/BM25 matchingExact term searches, error codes
semanticVector-based semantic similarityNatural language questions
hybridCombined keyword + semanticGeneral-purpose (recommended)

Step 8: Integrate with Virtual Agent and Now Assist

Connect AI Search to conversational interfaces.

Virtual Agent Search Source:

Use SN-Create-Record on sys_cs_ai_search_source:
  - name: "VA AI Search Integration"
  - search_profile: "<profile_sys_id>"
  - active: true
  - auto_summarize: true
  - fallback_action: "transfer_to_agent"
  - confidence_threshold: 0.65
  - max_results_shown: 3

REST Approach:

POST /api/now/table/sys_cs_ai_search_source
Body: {
  "name": "VA AI Search Integration",
  "search_profile": "<profile_sys_id>",
  "active": true,
  "auto_summarize": true,
  "fallback_action": "transfer_to_agent",
  "confidence_threshold": 0.65
}

Step 9: Monitor Search Quality

Query search analytics to understand performance.

MCP Approach:

Use SN-Query-Table on sn_ai_search_log:
  - query: search_profile=<profile_sys_id>^sys_created_on>javascript:gs.daysAgo(7)
  - fields: sys_id,query_text,result_count,click_through,feedback_score,rag_generated
  - limit: 50
  - orderBy: sys_created_on
  - orderDirection: desc

Track RAG answer quality:

Use SN-Query-Table on sn_ai_search_feedback:
  - query: search_profile=<profile_sys_id>^rating<3
  - fields: sys_id,query_text,answer_text,rating,feedback_comment
  - limit: 20

Step 10: Tune and Optimize

Based on analytics, adjust search configuration.

Adjust confidence threshold:

Use SN-Update-Record on sn_ai_search_profile:
  - sys_id: "<profile_sys_id>"
  - rag_confidence_threshold: 0.75

Update field boosting:

Use SN-Update-Record on sn_ai_search_field_config:
  - sys_id: "<field_config_sys_id>"
  - boost_factor: 4.0

Trigger index rebuild:

Use SN-Update-Record on sn_ai_search_index:
  - sys_id: "<index_sys_id>"
  - rebuild_requested: true

Tool Usage

ToolPurposeWhen to Use
SN-Query-TableFind existing sources, profiles, analyticsDiscovery and monitoring
SN-Create-RecordCreate sources, profiles, field configsInitial setup and expansion
SN-Update-RecordTune ranking, thresholds, rebuild indexesOptimization and maintenance
SN-Get-Table-SchemaDiscover configuration fieldsUnderstanding available settings

Best Practices

  1. Start with knowledge bases as the primary RAG source -- they have structured, curated content
  2. Use hybrid ranking combining semantic and keyword search for best results
  3. Set conservative confidence thresholds (0.7+) initially and lower only if needed
  4. Keep temperature low (0.2-0.4) for RAG to maintain factual accuracy
  5. Enable citations so users can verify answers against source material
  6. Chunk content appropriately -- too small loses context, too large dilutes relevance
  7. Boost title fields 3-5x over body text for better result relevance
  8. Monitor click-through rates and feedback scores to identify quality gaps
  9. Rebuild indexes regularly after knowledge base updates for fresh content
  10. Test with real user queries from search logs to validate ranking changes

Troubleshooting

IssueCauseResolution
No search results returnedSearch source inactive or no matching contentVerify source is active and content matches source_condition
RAG answer is hallucinatedTemperature too high or insufficient contextLower temperature, increase rag_max_sources, verify content quality
Irrelevant results ranked highField boost weights misconfiguredIncrease boost on title/description, decrease on body text
Search is slowLarge index or too many sources searchedLimit source_condition scope, optimize chunk_size, reduce max_results
RAG answer missing citationsCitations not enabled in gen AI configSet enable_citations=true in sn_gen_ai_config
Index out of dateRebuild schedule too infrequentTrigger manual rebuild or increase rebuild_schedule frequency
Duplicate resultsSame content indexed from multiple sourcesAdd source deduplication or narrow source_condition filters

Examples

Example 1: IT Self-Service AI Search

Configure AI Search for employee self-service portal:

  • Sources: IT Knowledge Base (published articles), Service Catalog (active items), FAQ knowledge base
  • Profile: Self-service with RAG enabled, max 5 results, confidence threshold 0.7
  • Ranking: Hybrid model, semantic_weight=0.6, keyword_weight=0.3, recency=0.1
  • RAG Config: Temperature 0.3, max 500 tokens, inline citations enabled
  • Integration: Virtual Agent with auto-summarize, fallback to live agent

Example 2: HR Policy Search with RAG

Configure AI Search for HR policy questions:

  • Sources: HR Knowledge Base (policy documents), HR Catalog (request forms)
  • Profile: HR-specific with strict RAG (temperature 0.1 for policy accuracy)
  • Chunking: 800 tokens with 100 overlap (preserves policy section context)
  • Field Boost: Policy title 5.0x, section headers 3.0x, body 1.0x
  • Guardrails: System prompt requires exact policy citations, prohibits paraphrasing legal language

Example 3: Multi-Source Technical Knowledge Search

Configure AI Search across multiple technical knowledge bases:

  • Sources: Infrastructure KB, Application KB, Security KB, resolved incidents
  • Profile: Technical support with high semantic weight (0.7) for natural language queries
  • Chunking: 500 tokens with 50 overlap for technical articles
  • Ranking: Boost recent articles (recency_weight=0.2) for evolving tech content
  • Monitoring: Track low-rated answers weekly, retrain on misses

Related Skills

  • genai/now-assist-qa - Conversational AI that consumes AI Search results
  • genai/skill-kit-custom - Custom skills that can invoke AI Search
  • knowledge/article-generation - Managing the knowledge content that feeds search
  • reporting/executive-dashboard - Building search analytics dashboards

Câu hỏi thường gặp

Kỹ năng AI Ai Search Rag làm được gì?

Configure retrieval-augmented AI search, including sources, indexing, ranking, answer generation, and search quality tuning.

Vì sao nên dùng Ai Search Rag trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Ai Search Rag là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Ai Search Rag trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/Happy-Technologies-LLC/happy-platform-skills/tree/main/skills/genai/ai-search-rag. TypingMind đọc tệp SKILL.md rồi cài đặt kỹ năng để bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Ai Search Rag?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Ai Search Rag với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Ai Search Rag với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Ai Search Rag có miễn phí không?

Có. Kỹ năng này được Happy-Technologies-LLC phát hành trên GitHub theo giấy phép Apache-2.0. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇