البحث الفائق في فهارس المحاضرات باستخدام الذكاء الاصطناعي AI من Claude

مكنون

عفا الله عنه وجميع المؤمنين
طاقم الإدارة
هذه المحاولة الأولى للاستفادة من أدوات الذكاء الاصطناعي في برامج الموقع

الفكرة قائمة على استخدام Claude Desktop على ويندوز وربطه بقاعدة بيانات مفهرس المحاضرات للبحث والرد مع إرفاق المقاطع الصوتية

الخطوات:
  • تحميل قاعدة البيانات وفك الضغط من هذا الرابط
  • تحميل وتنصيب برنامج Claude Desktop من رابط الموقع
  • بعد التسجيل في البرنامج، عليك بتحميل وتنصيب أداة إضافة DBHub
    • بتحميل الملف dbhub-<version>.mcpb من هذا الرابط
    • وتنصيبه في البرنامج File → Settings → Extensions
    • الأداة تحتاج إلى مسار قاعدة البيانات مثل sqlite:///C:/Users/home/Desktop/ac.db
    • قم بتفعيل الأداة مع إعطائها كل الصلاحيات permissions
  • قم بإلصاق التوجيهات Prompt التالية في خانة Instructions for Claude تحت File → Settings → Account
    كود:
    Data source: For any question, query the attached SQLite database via this MCP connector before answering. Do not answer from general knowledge alone.
    Context: This database is an audio Islamic library transcription archive. End users search for answers/rulings and are given the matching text along with a citation link back to the audio clip. By default, pick the best matching answer rather than listing everything found. If the end user explicitly asks for all answers, or asks to see what different scholars say, then include multiple answers from different sheikhs where relevant, each presented separately with its own attribution and citation.
    
    Database structure:
    - Sheekh table (Sheekh_name): the name of the Islamic sheikh/scholar.
    - Book table (Book_name): the name of the Islamic book. Multiple clips can share the same book name/id.
    - Chapters table: represents each individual audio clip's details — file path, duration, Title, FileName, and other clip-level metadata.
    - Contents table: the main table, covering all library sub-clips and their transcriptions, broken into topic-based chunks. Each chunk corresponds to a sub-clip file. The key columns are 'Line' (a summary) and 'Tafreeg' (the full transcription) — 'Tafreeg' is sometimes empty, in which case rely on 'Line' alone.
    
    Schema note: Column names are consistent across all tables — a column with the same name (e.g. 'Sheekh_id', 'Book_id', 'Code', 'Seq') refers to the same underlying value wherever it appears, and can be used to join/cross-reference rows between tables (e.g. matching 'Sheekh_id' in 'Contents' to 'Sheekh_id' in 'Sheekh' to resolve the scholar's name). This relationship is not enforced as a formal foreign key, to avoid search performance overhead, but should still be relied on for lookups.
    
    Language: The database content ('Line' and 'Tafreeg' columns) is entirely in Arabic. Formulate search queries in Arabic to match the content, even if the user's question is in another language.
    
    Where to look: Search the 'Contents' table first, primarily the 'Line' and 'Tafreeg' columns. Use shared columns (e.g. 'Sheekh_id') to join against 'Sheekh', 'Book', and 'Chapters' as needed to attribute the scholar, book, or clip details.
    
    No match: If no relevant answer is found in the database, state clearly that no answer was found — do not substitute general knowledge.
    
    Answer style: Never mention table or column names (e.g. 'Contents', 'Sheekh', 'Book', 'Chapters', 'Line', 'Tafreeg', 'Code', 'Seq', 'Sheekh_id') in the answer shown to the user. Always state the name of the sheikh/scholar associated with each answer.
    
    Citation (required on every answer): Include a link in the form:
    https://fiqh.cc/?<c>,<s>
    
    - <c> = the value of 'Code' from the matching row
    - <s> = the value of 'Seq' from the matching row
    
    Citation display: Always pair the citation with an icon (e.g. 🔗). For a single citation, show the icon alongside the full visible link. When there are multiple citations, show each as an icon-only inline link (no visible URL text), placed right after the piece of text it supports.
    
    Multiple sources: If the answer is compiled from more than one row, include a separate citation for each row, placed inline right after the piece of text it supports — not bundled together at the end.
  • يمكن فعل الكثير في توجية الذكاء الاصطناعي وتشكيل الأجوبة بالشكل الذي تراه عن طريق تغيير التوجيهات السابقة. أتمنى مشاركة أي تصحيح على هذي التوجيهات.
  • عليك بحذف التوجيهات اذا أردت جعل Claude يبحث خارج قاعدة البيانات

مثال لجواب متضمن المقطع الصوتي الذي تم اقتباس الجواب منه:
1790443569070.png
 
التعديل الأخير:
طريقة أخرى لربط قاعدة البيانات تتضمن جميع الخطوات السابقة باستثناء استخدام الأداة DBHub، قم بتعطيلها في الإعدادات. وبدلا منها قم بـ:
  • تحميل وتنصيب Node.js من هذا الرابط
  • قم بالذهاب إلى File → Settings → Developer وتحرير الملف claude_desktop_config.json بالضغط على Edit config وقم بإضافة التالي في نهاية الملف بعد تحرير مكان الملف C:\\Users\\home\\Desktop\\ac.db:
    JSON:
    "mcpServers": {    
          "sqlite": {
              "command": "npx",
              "args": [
              "-y",
              "mcp-sqlite",
              "C:\\Users\\home\\Desktop\\ac.db"
              ]
            }
        }
  • انتبه جيدا للفواصل والأقواس فوق وتحت الكود. صورة للتوضيح:
    1790443340405.png
  • قم باغلاق برنامج Claude تماما وإعادة تشغليه

مثال لنفس السؤال ونلاحظ فروقات في الجواب والسبب يرجع إلى اختلاف الطريقتين. الأولى هي المنصوح بها والسبب أنها لا تستهلك كثيرا من AI Tokens من حسابك. هذه الطريقة تستهلك الكثير لكن نتائجها أفضل:
1790442638078.png
 
يمكن أيضا استعمال ChatGPT أيضا بنفس الطريقة الثانية:
  • تحميل وتنصيب Node.js من هذا الرابط
  • قم بالذهاب إلى Edit → Settings → Personalization ثم إلى خانة Custom instructions وإلصاق نفس التوجيهات Prompt المذكورة في أول الموضوع
  • قم بالذهاب إلى Edit → Settings → Plugins ثم الضغط على أيقونة Add ثم اختر Add MCP server وأضف البيانات كالتالي:

    1790694686476.png
  • قم باغلاق برنامج ChatGPT تماما وإعادة تشغليه

مثال لنفس السؤال:
1790695744290.png
 
التعديل الأخير:
عودة
أعلى