Back to developer docs
Knowledge base (RAG)

How to Prepare Knowledge Files for Optimal AI Answers

AI Support Assistant answers only from the documents you upload, with citations, and says so and offers a handoff when no source supports an answer. This page is public: share the link with your team or hand it to any AI model to help you prepare your files.

Watch the video walkthrough

A recorded walkthrough of the O My Syria AI assistant, in Arabic, for anyone who prefers watching to reading.

The Document Journey: From Upload to Grounded Answer

Understanding this simple 3-step workflow will help you format files for maximum retrieval precision:

  1. Extraction & Semantic Chunking

    The system extracts text and breaks it into cohesive 2KB to 3KB chunks, preserving document headings, paragraphs, and list structures.

  2. Precise Semantic Retrieval

    When a customer asks a question, the search engine retrieves the exact chunks that directly relate to the question's meaning.

  3. Grounded Answer with Citation

    The assistant reads only the retrieved evidence and generates a direct answer, citing the exact source file and section without making assumptions.

5 Essential Rules for Accurate Answers

  1. 01

    Use Clear, Hierarchical Headings

    Divide documents into logical sections with clear headings (e.g., 'Return Policy', 'Business Hours'). Headings provide isolated context for each chunk.

  2. 02

    One Single Topic per Paragraph

    Dedicate each paragraph to a specific condition or rule. Avoid mixing unrelated policies into dense blocks of text, and write definitive, self-contained answers.

  3. 03

    Use Real Searchable Text, Avoid Image Scans

    Ensure PDF files contain selectable, copyable text. Scanned image-only PDFs require OCR processing and may suffer from character recognition inaccuracies.

  4. 04

    Prevent Conflicts & Replace Outdated Files

    When policies or prices change, use the 'Replace Source' feature to upload the new version rather than keeping multiple conflicting documents active.

  5. 05

    Consistent Terminology & Clean Formatting

    Use unified names for your services across all files and avoid heavy decorative styling or excessive punctuation that might impede search matching.

Do's and Don'ts: Side-by-Side Examples

Real-world examples illustrating the difference between AI-friendly structuring and formatting patterns that cause uncertainty:

FAQ Structuring

Recommended & Optimal ✓

Self-contained Question & Complete Answer

### Q: What is the return window for purchased items?
A: Customers may request a return within 14 calendar days of delivery, provided the item is unused, in original packaging, and accompanied by the receipt.

Discouraged & Avoid ✗

Unstructured wall of text without clear Q&A boundaries

Returns are usually available around two weeks or so depending on condition if the item is fine and you have the bill you can send it back or call support.

Why: A self-contained Q&A pair lives neatly within one chunk, which makes retrieval and citation more precise.

Policies & Conditions

Recommended & Optimal ✓

Structured Bullet Points for Conditions & Exclusions

### Device Warranty Policy
- Warranty Period: 24 months from purchase date.
- Covered: Manufacturer defects and internal hardware failures.
- Excluded: Physical drops, liquid damage, and unauthorized third-party repairs.

Discouraged & Avoid ✗

Dense narrative mixing rules and exceptions together

We provide a two-year warranty for devices except drops and water damage and fix manufacturing defects with invoice but unauthorized repair voids it.

Why: Bulleted lists allow retrieval algorithms to distinguish inclusions from exclusions without blending conditions.

Product Specifications & Pricing

Recommended & Optimal ✓

Clean, isolated tier specifications

### Business Plan
- Price: $150 / month
- Users: Up to 10 team members
- Cloud Storage: 50 GB included
- Support: 24/7 priority live chat

Discouraged & Avoid ✗

Complex merged tables or fragmented unorganized text

Plans: Basic, Business, Pro at $50 / $150 / $300 for 3, 10, 25 users with 10, 50, 100 GB storage and standard or priority support options.

Why: Explicit attributes prevent the assistant from quoting one plan's pricing to a user asking about a different tier.

Document Templates for Common Scenarios

Copy these pre-formatted blueprints, fill them in with your organization's data, and upload them as .docx or .md files:

Frequently Asked Questions (FAQ) Blueprint

The highest-performing format for direct customer support queries.

# Frequently Asked Questions - [Company Name]

## Account & Registration

### Q: How do I create a new account?
A: Click the 'Sign Up' button at the top of the homepage, enter your work email and password, and verify the verification link sent to your inbox.

### Q: How do I reset my password?
A: Navigate to Account Settings > Security > Change Password, then enter your current password and choose a new one.

## Billing & Payment

### Q: What payment methods are supported?
A: We accept Visa, MasterCard, American Express, and bank wire transfers for invoiced contracts.

Arabic & Bilingual Content Guidelines

O My Syria is built for Arabic first. These tips improve bilingual matching:

  • Unified Terminology

    Consistently use the same term throughout your documents (e.g., standardise on 'الدعم الفني' rather than randomly alternating between 'خدمة المساندة' and 'المساعدة المباشرة').

  • Avoid Excessive Diacritics & Tatweel

    The system applies search normalization, but non-standard diacritics or decorative elongation letters (ـ) inside words can prevent exact keyword matching.

  • Include Both Arabic & English Brand Terms

    If your product has English and Arabic names, list both together (e.g., 'جهاز التوجيه الذكي (Smart Router X1)').

  • Standardized Numbers and Currency Codes

    Write numerical values and currencies in clear standard formats (e.g., '$150 USD' or '150,000 SYP') instead of ambiguous slang.

Supported Formats & System Constraints

  • Supported File Formats

    The platform accepts Adobe PDF, Microsoft Word (.docx), plain UTF-8 text (.txt), and Markdown (.md). The server validates actual file bytes on upload.

    PDF, DOCX, TXT, MD
  • Maximum File Size

    The default server upload ceiling is 10 MiB per file, which comfortably accommodates thousands of pages of structured text.

    10 MiB per file
  • PDF Text Layer Requirement

    Ensure PDFs are exported directly from word processors with selectable text. Scanned raster images require OCR processing and may take longer to ingest.

    Selectable Text
  • UTF-8 Text Encoding

    Always save text files in UTF-8 encoding to preserve Arabic character glyphs and special punctuation marks cleanly.

    UTF-8 Encoding
  • Atomic Version Replacement

    When updating a document, use 'Replace Source'. The current ready version remains active until the new version completes indexing, ensuring zero downtime.

    Atomic Replacement

Ready to test your answers?

Create an account, upload your first document to a project, then test grounded answers right away in the Playground.