> ## Documentation Index
> Fetch the complete documentation index at: https://docs.arcbeam.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Data Sources

> Where your AI gets its knowledge from

**Data sources** are where your AI gets the information it needs to answer questions and help users. Think of them as the AI's library of knowledge.

<Info>
  Just like a person needs to learn information before they can answer questions, your AI needs access to information. Data sources are the places where this information lives.
</Info>

## Understanding Data Sources

<Tabs>
  <Tab title="Company Documentation" icon="building">
    <CardGroup cols={2}>
      <Card title="Product Manuals" icon="book" />

      <Card title="Internal Wikis" icon="network-wired" />

      <Card title="FAQs" icon="circle-question" />

      <Card title="Policy Documents" icon="file-contract" />
    </CardGroup>
  </Tab>

  <Tab title="Customer Information" icon="users">
    <CardGroup cols={2}>
      <Card title="Support Tickets" icon="ticket" />

      <Card title="CRM Data" icon="database" />

      <Card title="Purchase History" icon="cart-shopping" />

      <Card title="Customer Preferences" icon="sliders" />
    </CardGroup>
  </Tab>

  <Tab title="External Information" icon="globe">
    <CardGroup cols={2}>
      <Card title="Real-time APIs" icon="plug" />

      <Card title="Public Databases" icon="database" />

      <Card title="Third-party Services" icon="cloud" />

      <Card title="News & Updates" icon="newspaper" />
    </CardGroup>
  </Tab>

  <Tab title="File Storage" icon="folder">
    <CardGroup cols={2}>
      <Card title="PDF Documents" icon="file-pdf" />

      <Card title="Office Files" icon="file-word" />

      <Card title="Cloud Storage" icon="cloud-arrow-up" />

      <Card title="File Servers" icon="server" />
    </CardGroup>
  </Tab>
</Tabs>

## Why Data Sources Matter

### Your AI is Only as Good as its Data

<Warning>
  The quality of your AI's responses directly depends on the quality of the information you give it.
</Warning>

<CardGroup cols={2}>
  <Card title="Accurate Information" icon="circle-check">
    Your AI gives correct answers that users can trust
  </Card>

  <Card title="Up-to-date Information" icon="clock-rotate-left">
    Your AI doesn't provide outdated information
  </Card>

  <Card title="Relevant Information" icon="bullseye">
    Your AI stays on topic and focused
  </Card>

  <Card title="Complete Information" icon="layer-group">
    Your AI can answer more questions comprehensively
  </Card>
</CardGroup>

<Tip>
  **Example**: If your AI is helping customers with product questions, but your product documentation is from 2 years ago, it will give outdated answers about features and prices.
</Tip>

### Different Sources Enable Different Features

The type of data source determines what your AI can do:

<CardGroup cols={2}>
  <Card title="Documentation" icon="book">
    Answer questions about your products or services with comprehensive knowledge base access
  </Card>

  <Card title="Real-time APIs" icon="bolt">
    Provide current information like order status, weather, or live inventory
  </Card>

  <Card title="Customer Data" icon="user">
    Personalize responses based on user history, preferences, and past interactions
  </Card>

  <Card title="File Systems" icon="folder-tree">
    Search through and summarize large documents stored across your organization
  </Card>
</CardGroup>

## What is a Vector Database?

<Info>
  Vector databases are specialized systems designed for storing and searching semantic information. They're the backbone of modern RAG (Retrieval-Augmented Generation) systems, enabling AI applications to find relevant information based on meaning rather than just keywords.
</Info>

### Why Traditional Databases Don't Work for AI

Traditional databases excel at exact matches—finding "iPhone 15" when you search for "iPhone 15". But they struggle with semantic searches like:

* "smartphone with the best camera" (should find iPhone 15, Pixel 8, etc.)
* "how do I reset my password?" (should find password reset documentation)
* "troubleshooting connection issues" (should find network, wifi, and connectivity docs)

**The Problem**: AI needs to understand meaning and context, not just match words.

### How Vector Databases Work

Vector databases solve this by converting text into numerical representations that capture semantic meaning:

<Steps>
  <Step title="Chunking Documents">
    Your documents are broken into smaller, meaningful pieces (typically 100-500 words). This could be paragraphs, sections, or logical units of information.

    **Why chunking matters**: Smaller chunks give more precise retrieval. If someone asks about "pricing", you want the pricing section, not the entire 50-page manual.
  </Step>

  <Step title="Creating Embeddings">
    Each chunk is converted into a **vector embedding**—a list of numbers (typically 768-1536 dimensions) that represents its semantic meaning.

    **The magic**: Similar concepts have similar vectors. "refund policy" and "return process" will have vectors close together in mathematical space, even though they use different words.

    <Info>
      Embeddings are created using machine learning models like OpenAI's `text-embedding-3-large` or open-source models like `all-MiniLM-L6-v2`. These models have learned semantic relationships from billions of documents.
    </Info>
  </Step>

  <Step title="Indexing for Fast Retrieval">
    Vector databases use specialized algorithms (like HNSW, IVF, or FAISS) to organize vectors for lightning-fast similarity searches—even across millions of documents.

    **Performance**: Finding the top 10 relevant documents from 10 million can happen in milliseconds.
  </Step>

  <Step title="Semantic Search">
    When someone asks a question:

    1. The question is converted to a vector using the same embedding model
    2. The database finds vectors closest to the question vector (using cosine similarity or other distance metrics)
    3. The corresponding text chunks are retrieved and ranked by relevance

    **Result**: You get semantically relevant content, not just keyword matches.
  </Step>

  <Step title="Retrieval-Augmented Generation (RAG)">
    The retrieved chunks are provided as context to your AI model (like GPT-4 or Claude), which uses them to generate an informed, accurate response.

    **Why this works**: The AI can reference specific information from your knowledge base instead of relying solely on its training data.
  </Step>
</Steps>

### What Gets Stored

For each document chunk in a vector database, you typically store:

<CardGroup cols={2}>
  <Card title="Vector Embedding" icon="chart-network">
    The numerical representation (e.g., 1536 floating-point numbers) capturing the semantic meaning
  </Card>

  <Card title="Original Text" icon="file-lines">
    The actual content to be retrieved and shown to users or passed to the AI
  </Card>

  <Card title="Source Metadata" icon="link">
    Which document, page, section, or URL it came from for attribution
  </Card>

  <Card title="Timestamps" icon="calendar">
    When the content was added, last updated, or verified for freshness tracking
  </Card>

  <Card title="Custom Metadata" icon="tags">
    Categories, departments, access levels, product names, or any filterable attributes
  </Card>

  <Card title="Chunk Position" icon="list-ol">
    Information about where this chunk appears in the original document for context
  </Card>
</CardGroup>

### Vector Database vs. Traditional Database

| Feature                | Traditional Database                     | Vector Database                                      |
| ---------------------- | ---------------------------------------- | ---------------------------------------------------- |
| **Search Type**        | Exact keyword matching                   | Semantic similarity search                           |
| **Query**              | "password reset" finds only exact phrase | "I forgot my login" finds password reset docs        |
| **Storage**            | Structured data in rows/columns          | Vectors + unstructured text + metadata               |
| **Primary Use**        | Transactions, records, business data     | AI/ML applications, semantic search, recommendations |
| **Performance Metric** | Query speed, transactions/sec            | Similarity search speed, recall\@k                   |
| **Examples**           | PostgreSQL, MySQL, MongoDB               | Pinecone, Weaviate, Qdrant, Chroma, pgvector         |

### Hybrid Search: Best of Both Worlds

Many modern applications combine vector search with traditional filters for even better results:

**Example scenario**: You want to find documents about "troubleshooting network issues" but only from:

* The "Enterprise Router" product line (not all products)
* The Support department (not Sales or Marketing docs)
* Documents updated after January 1, 2024 (only recent information)

With hybrid search, you get:

* **Semantic search** finding documents about network problems, connectivity issues, wifi troubleshooting, etc. (even if they don't use the exact words "network issues")
* **Traditional filters** narrowing results to exactly the product, department, and date range you need

This gives you semantic understanding plus the precision of traditional database filters—the best of both approaches.

## Connecting Your Data

<Steps>
  <Step title="Identify what information your AI needs">
    Ask yourself these questions:

    * What questions will users ask?
    * What knowledge does the AI need to answer those questions?
    * Where does that knowledge currently live?
  </Step>

  <Step title="Choose where to store it">
    <Info>
      For most AI applications, you'll use a vector database
    </Info>

    **Popular options**:

    <CardGroup cols={4}>
      <Card title="Pinecone" icon="database" />

      <Card title="Weaviate" icon="database" />

      <Card title="Qdrant" icon="database" />

      <Card title="pgvector" icon="database" />
    </CardGroup>
  </Step>

  <Step title="Prepare your information">
    * Gather your documents, FAQs, and other content
    * Make sure the information is accurate and current
    * Organize it in a logical way
  </Step>

  <Step title="Load it into the database">
    Your documents get processed and stored through an automated process. This can be done once or set up to update regularly.
  </Step>

  <Step title="Test and refine">
    * **Testing**: Ask test questions to see if the AI finds the right information
    * **Adjusting**: Adjust what information is included based on results
    * **Monitoring**: Monitor which content gets used most
  </Step>
</Steps>

## Keeping Your Data Fresh

### Why Updates Matter

<Warning>
  Imagine if your AI was trained on last year's pricing but you've since updated your prices. Customers would get wrong information, leading to confusion and potentially lost sales.
</Warning>

### How to Keep Data Current

**Set update schedules**:

<CardGroup cols={3}>
  <Card title="Daily Updates" icon="clock">
    For information that changes frequently (like inventory)
  </Card>

  <Card title="Weekly Updates" icon="calendar-week">
    For moderately changing content (like blog posts)
  </Card>

  <Card title="Monthly Updates" icon="calendar">
    For stable content (like company policies)
  </Card>
</CardGroup>

**Track versions**:

* Know which version of each document is currently being used
* Keep a history of changes
* Be able to roll back if needed

**Monitor for staleness**:

* Get alerts when information hasn't been updated in a while
* Regularly review what's in your database
* Remove outdated content

**Automate when possible**:

<CardGroup cols={3}>
  <Card title="Auto Imports" icon="file-import">
    Set up automatic imports from your documentation system
  </Card>

  <Card title="Scheduled Jobs" icon="clock-rotate-left">
    Schedule regular refresh jobs
  </Card>

  <Card title="Auto Sync" icon="arrows-rotate">
    Sync with source systems automatically
  </Card>
</CardGroup>

## Data Quality Best Practices

### Keep Your Sources Organized

**Use clear naming**:

<CardGroup cols={2}>
  <Card title="Good Example" icon="circle-check">
    `Product_Manual_2024.pdf`
  </Card>

  <Card title="Bad Example" icon="circle-xmark">
    `doc_final_v2_FINAL.pdf`
  </Card>
</CardGroup>

* Include dates in file names when relevant
* Use consistent naming conventions

**Add helpful tags and categories**:

* Tag by product, department, or topic
* Include categories like "support", "sales", "technical"
* Add keywords that users might search for

**Track where information came from**:

* Note the original source file or system
* Include the author or owner
* Record when it was last updated

### Maintain Quality Standards

<CardGroup cols={3}>
  <Card title="Regular Audits" icon="magnifying-glass-chart">
    * Review your content quarterly
    * Check for outdated information
    * Verify accuracy of key facts
  </Card>

  <Card title="User Feedback" icon="comments">
    * Pay attention to when users say "that's not right"
    * Track which answers get poor ratings
    * Use this to identify content that needs updating
  </Card>

  <Card title="Remove What Doesn't Work" icon="trash">
    * Delete duplicate content
    * Remove irrelevant information
    * Archive old versions
  </Card>
</CardGroup>

## Monitoring Your Data Sources

### What to Track

**How fresh is your data?**

* When was each piece of content last updated?
* How long since your last sync or refresh?
* Are there warnings about stale content?

**How well is it working?**

<CardGroup cols={3}>
  <Card title="User Success" icon="thumbs-up">
    Are users finding what they need?
  </Card>

  <Card title="Document Usage" icon="chart-simple">
    Which documents get used most?
  </Card>

  <Card title="Coverage Gaps" icon="chart-line-up">
    Where are the gaps in coverage?
  </Card>
</CardGroup>

**What's it costing?**

* Storage costs for your database
* Costs for processing and updating content
* API costs for external data sources

### Signs of Problems

<AccordionGroup>
  <Accordion title="Your AI gives outdated answers" icon="clock-rotate-left">
    **Problem**: Your data isn't being updated frequently enough

    **Solution**: Increase update frequency and set up automated syncs
  </Accordion>

  <Accordion title="Your AI can't answer basic questions" icon="circle-question">
    **Problem**: You're missing important content

    **Solution**: Review your data sources and add missing documentation
  </Accordion>

  <Accordion title="Your AI often says 'I don't know'" icon="face-frown">
    **Problem**: You need more comprehensive coverage

    **Solution**: Expand your knowledge base with additional sources
  </Accordion>

  <Accordion title="Responses are slow" icon="gauge">
    **Problem**: Your database might need optimization

    **Solution**: Review database indexing and consider scaling options
  </Accordion>
</AccordionGroup>

## Data Security and Privacy

### Protecting Sensitive Information

**Control who has access**:

<CardGroup cols={3}>
  <Card title="Permissions" icon="shield-halved">
    Not everyone should see all data - set up proper permissions
  </Card>

  <Card title="Audit Logs" icon="list-check">
    Log who accesses what for security tracking
  </Card>

  <Card title="Role-Based Access" icon="users-gear">
    Define different access levels for different roles
  </Card>
</CardGroup>

**Handle personal information carefully**:

<Warning>
  Be aware of privacy regulations (GDPR, HIPAA, etc.)
</Warning>

* Remove or anonymize personal details when possible
* Have clear policies for data retention
* Document your data handling procedures

**Compliance requirements to consider**:

* GDPR for EU data
* HIPAA for healthcare information
* CCPA for California residents
* Industry-specific regulations

**Keep credentials secure**:

<CardGroup cols={3}>
  <Card title="No Hardcoded Secrets" icon="ban">
    Never put passwords or API keys in your documents
  </Card>

  <Card title="Secure Storage" icon="vault">
    Use secure methods to store access credentials
  </Card>

  <Card title="Regular Rotation" icon="arrows-rotate">
    Rotate keys and passwords regularly
  </Card>
</CardGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Data Processing" icon="gears" href="/v0/core-concepts/data-processing">
    Learn how to prepare your data for AI
  </Card>

  <Card title="Data Lineage" icon="link" href="/v0/core-concepts/data-lineage">
    Track where information comes from
  </Card>

  <Card title="Setup Guide" icon="plug" href="/v0/setup/add-data-sources">
    Step-by-step instructions to connect your data
  </Card>

  <Card title="Observability" icon="chart-line" href="/v0/core-concepts/observability">
    Monitor how your data is being used
  </Card>
</CardGroup>
