> ## 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.

# Connect Your Data Sources

> Connect your vector databases to Arcbeam to see which documents influenced each trace

Connecting your <Tooltip tip="Vector databases store embeddings and enable semantic search for RAG applications">vector databases</Tooltip> to Arcbeam creates a complete picture of your AI system. You'll see not just what your model said, but exactly which documents from your knowledge base influenced each response.

## Why Connect Data Sources?

When you only see traces without data sources, you know your AI system produced an answer but you don't know where it came from. Was it hallucinating? Did it retrieve the right documents? Which parts of your knowledge base are actually being used?

**With data sources connected**, every trace shows:

<CardGroup cols={2}>
  <Card title="Document Attribution" icon="link">
    Which specific documents were retrieved and their exact content
  </Card>

  <Card title="Usage Analytics" icon="chart-bar">
    How often each document is used across all queries
  </Card>

  <Card title="Quality Insights" icon="sparkles">
    Which documents need updating or improvement
  </Card>

  <Card title="Actionable Data" icon="lightbulb">
    Turn observability into concrete improvements
  </Card>
</CardGroup>

## How It Works

<Steps>
  <Step title="Choose your source">
    Navigate to `Data Platform` → `Data Sources` and choose your data source.

    <Frame caption="Navigate to the data source pages">
      <img src="https://mintcdn.com/arcbeam/1fTGlrw8Tdounskc/images/setup/datasources.png?fit=max&auto=format&n=1fTGlrw8Tdounskc&q=85&s=8d329da7e5424654407a465a72ad3741" alt="Data Sources page." width="2940" height="1386" data-path="images/setup/datasources.png" />
    </Frame>
  </Step>

  <Step title="Connect your vector database">
    Tell Arcbeam how to access your <Tooltip tip="PostgreSQL with the pgvector extension for storing and querying vector embeddings">pgvector database</Tooltip>.

    <Frame caption="Connect your vector database">
      <img src="https://mintcdn.com/arcbeam/1fTGlrw8Tdounskc/images/setup/connect-vector.png?fit=max&auto=format&n=1fTGlrw8Tdounskc&q=85&s=169ea49c12bd96664473a8621389eefb" alt="Connect your vector database." width="2940" height="1614" data-path="images/setup/connect-vector.png" />
    </Frame>
  </Step>

  <Step title="Map your schema">
    Type which fields contain your document content, IDs, and metadata.

    <Info>
      For nested columns type them out with a `.` in between each level.

      Example: If the field you want to reference is col3 in `{'col1' : {'col2': {'col3': 'value'}}}`, then type in `col1.col2.col3`
    </Info>

    <Frame caption="Specify the schema mapping of your vector database.">
      <img src="https://mintcdn.com/arcbeam/1fTGlrw8Tdounskc/images/setup/schema.png?fit=max&auto=format&n=1fTGlrw8Tdounskc&q=85&s=9654273c6d6730dc890e19a9464cd3f2" alt="Specify schema." width="2940" height="1442" data-path="images/setup/schema.png" />
    </Frame>
  </Step>

  <Step title="Sync once">
    Arcbeam pulls metadata about your documents (not the vectors themselves).
  </Step>

  <Step title="See the connections">
    When traces come in, Arcbeam automatically links retrieved documents to each query.

    <Check>
      Your data sources are now connected and enriching your traces!
    </Check>
  </Step>
</Steps>

## What Gets Synced

<Info>
  Arcbeam syncs **metadata about your documents**, not the documents themselves.
</Info>

| Data Type             | Synced?     | Description                                                                                                                                                |
| --------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Document IDs          | ✓ Yes       | To match retrieved docs in traces                                                                                                                          |
| Source attribution    | ✓ Yes       | Which file/URL each document came from                                                                                                                     |
| Basic metadata        | ✓ Yes       | Timestamps, document names, etc.                                                                                                                           |
| Document content      | ✓ Yes       | Text content of documents (stays in your DB, referenced in traces)                                                                                         |
| **Vector embeddings** | ✗ **Never** | Your <Tooltip tip="Vector embeddings are numerical representations of text used for semantic search">vectors and embeddings</Tooltip> are **never synced** |
| Unmapped fields       | ✗ **Never** | Only the metadata fields you explicitly specify are copied                                                                                                 |

<Info>
  The actual document content stays in your vector database. Arcbeam only stores what's needed to show you which documents were used in each trace.
</Info>

## Supported Vector Databases

<CardGroup cols={2}>
  <Card title="pgvector" icon="database" href="/v0/integrations/vector-databases/pgvector">
    PostgreSQL with pgvector extension (fully supported)
  </Card>

  <Card title="Coming Soon" icon="hourglass">
    Pinecone, Weaviate, Chroma, and others
  </Card>
</CardGroup>

## Privacy and Security

<AccordionGroup>
  <Accordion title="What Data is Accessed" icon="eye">
    Arcbeam only reads the fields you explicitly map:

    | Field Type                | Accessed?   | Description                                     |
    | ------------------------- | ----------- | ----------------------------------------------- |
    | Document IDs              | ✓ Yes       | Required to match documents in traces           |
    | Document content (text)   | ✓ Yes       | Document text content for display               |
    | Source attribution fields | ✓ Yes       | Track which file/URL documents came from        |
    | Metadata fields           | ✓ Optional  | Only fields you explicitly map in configuration |
    | Timestamp fields          | ✓ Optional  | Only if you configure last updated tracking     |
    | **Vector embeddings**     | ✗ **Never** | Your embeddings are never accessed or synced    |
    | **Unmapped fields**       | ✗ **Never** | Only explicitly mapped fields are read          |
  </Accordion>

  <Accordion title="Connection Security" icon="lock">
    * Connection strings are encrypted at rest
    * Database credentials are never logged or exposed
    * All connections use SSL/TLS when available
    * Read-only access is recommended

    <Tip>
      Create a dedicated read-only database user for Arcbeam to minimize security risk.
    </Tip>
  </Accordion>

  <Accordion title="Self-Hosted Option" icon="server">
    If your data can't leave your infrastructure:

    * Run Arcbeam in your own VPC
    * Keep all data within your network
    * Full control over data storage and access

    [Learn more about self-hosting →](/v0/deployment/self-host)
  </Accordion>
</AccordionGroup>

## When to Connect Data Sources

| Use Case                                                                                                                                                                         | Connect Data Sources? | Why                                                  |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | ---------------------------------------------------- |
| Using <Tooltip tip="Retrieval-Augmented Generation enhances LLM responses by retrieving relevant documents from a knowledge base">RAG (retrieval-augmented generation)</Tooltip> | ✓ **Yes**             | Track which documents are retrieved and their impact |
| Track which documents are most useful                                                                                                                                            | ✓ **Yes**             | See usage analytics and document performance         |
| Debug why certain answers were given                                                                                                                                             | ✓ **Yes**             | Trace answers back to source documents               |
| Measure knowledge base quality                                                                                                                                                   | ✓ **Yes**             | Identify gaps and improvement opportunities          |
| Only using direct LLM calls (no retrieval)                                                                                                                                       | ✗ Skip                | No document retrieval to track                       |
| Just want to track costs and errors                                                                                                                                              | ✗ Skip                | Traces alone provide this information                |
| Using function calling without RAG                                                                                                                                               | ✗ Skip                | No vector database retrieval involved                |

## Quick Example

Here's what connecting a pgvector database looks like:

```python theme={null}
# Your vector database has a table with this structure:
# CREATE TABLE knowledge_base (
#   id TEXT PRIMARY KEY,
#   content TEXT,
#   source TEXT,
#   updated_at TIMESTAMP
# );

# In Arcbeam dashboard:
# 1. Add pgvector integration
# 2. Provide connection string
# 3. Map schema:
#    - ID field: "id"
#    - Document field: "content"
#    - Source field: "source"
#    - Last updated: "updated_at" (optional)
```

Once connected, traces automatically show which documents were retrieved:

<Frame caption="Retrieved Source Data">
  <img src="https://mintcdn.com/arcbeam/1w-VO_d-egvziFR1/images/debug/trace-details.png?fit=max&auto=format&n=1w-VO_d-egvziFR1&q=85&s=26400d73a6c74f7a5739a6fc062771e8" alt="Chunks from your source data your AI system used." width="3790" height="2292" data-path="images/debug/trace-details.png" />
</Frame>

## What You Can Do With Connected Data

<CardGroup cols={2}>
  <Card title="Track Document Usage" icon="chart-line" href="/v0/data-insights/see-what-data-is-used">
    See which documents are retrieved most often, which are never used, and which ones lead to good vs bad responses.
  </Card>

  <Card title="Debug RAG Pipelines" icon="bug" href="/v0/debugging/understand-retrieval-quality">
    When a trace shows wrong information, see exactly which documents were retrieved and whether they contained the right content.
  </Card>

  <Card title="Measure Knowledge Base Quality" icon="gauge" href="/v0/data-insights/dataset-analytics">
    Find gaps in your knowledge base by seeing which queries don't retrieve useful documents.
  </Card>

  <Card title="Improve with User Feedback" icon="thumbs-up" href="/v0/collaboration/review-traces-together">
    When users give thumbs down, see which documents were involved and update them accordingly.
  </Card>
</CardGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Connect pgvector" icon="database" href="/v0/integrations/vector-databases/pgvector">
    Step-by-step guide to connecting a pgvector database
  </Card>

  <Card title="Data Lineage" icon="arrows-rotate" href="/v0/core-concepts/data-lineage">
    Understand how data flows through your system
  </Card>

  <Card title="View Retrieved Documents" icon="file-lines" href="/v0/debugging/trace-issues-to-source-data">
    Explore retrieved documents in traces
  </Card>

  <Card title="Track Document Usage" icon="chart-line" href="/v0/data-insights/see-what-data-is-used">
    Analyze which documents are being used
  </Card>
</CardGroup>

## Common Questions

<AccordionGroup>
  <Accordion title="Does this slow down my database?">
    No. Syncing is a one-time operation that reads metadata. It doesn't run queries during normal operation. Your application's vector database queries are completely separate.
  </Accordion>

  <Accordion title="What if my schema changes?">
    Update the schema mapping in Arcbeam, then trigger a re-sync. Arcbeam will refresh the metadata.
  </Accordion>

  <Accordion title="Can I connect multiple databases?">
    Yes. You can connect multiple vector databases or different tables/indices within the same database. Each becomes a separate dataset in Arcbeam.
  </Accordion>

  <Accordion title="Do I need read-write access?">
    No. Arcbeam only needs read access to your vector database. Using a read-only user is recommended for security.
  </Accordion>

  <Accordion title="What if I'm using multiple vector databases?">
    Connect each one separately. Arcbeam will track documents across all of them and show you which database was used for each retrieval.
  </Accordion>
</AccordionGroup>
