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

# Storing

> Store, edit, and delete SDK chunks in vector databases.

Storing writes embedded chunks to Qdrant, Pinecone, or Weaviate. In the full SDK workflow, `rag.ingest()` stores embedded chunks for you. Use `rag.store()`, `rag.edit()`, and `rag.delete()` directly for manual pipelines and maintenance.

```python theme={null}
from ragrails import RagRails

rag = RagRails(
    collection="support",
    vector_store={"provider": "qdrant", "url": "http://localhost:6333"},
    embedding={"provider": "voyage", "model": "voyage-3"},
)
```

## Store

```python theme={null}
stored = rag.store(embedded_chunks=embedded.items, batch_size=64)
```

```python theme={null}
stored.inputs
stored.stored
stored.items
stored.failed
stored.provider
stored.collection
stored.errors
```

The collection is created automatically by default.

| Parameter           | Default                              | Description                                          |
| ------------------- | ------------------------------------ | ---------------------------------------------------- |
| `embedded_chunks`   | required                             | List of chunk dicts with `embedding`.                |
| `vector_db`         | constructor default, else `"qdrant"` | `qdrant`, `qdrant_cloud`, `pinecone`, or `weaviate`. |
| `collection`        | constructor default                  | Collection, index, or class name.                    |
| `url`               | constructor default                  | Vector DB URL.                                       |
| `batch_size`        | `64`                                 | Chunks per upsert batch.                             |
| `ensure_collection` | `True`                               | Create the collection if missing.                    |
| `options`           | `None`                               | Provider-specific options.                           |

## Edit

`edit()` re-embeds replacement chunks and replaces stored records by exact ID.

```python theme={null}
edited = rag.edit(chunks=[
    {
        "id": "refund-policy-0",
        "text": "Refunds are returned to the original payment method within 3 to 5 business days.",
        "source": "files/refund-policy.pdf",
        "metadata": {"title": "Refund policy"},
    }
])
```

Pass `embedder=...` to control the re-embedding model for this edit.

## Delete

```python theme={null}
deleted = rag.delete(ids=["refund-policy-0", "refund-policy-1"])
```

Deletes are exact-ID operations. They do not perform semantic matching.

## Vector Database Names

| Database     | `vector_db`    | Install              | Notes                                                           |
| ------------ | -------------- | -------------------- | --------------------------------------------------------------- |
| Qdrant local | `qdrant`       | `ragrails[qdrant]`   | Use a local or network Qdrant URL.                              |
| Qdrant Cloud | `qdrant_cloud` | `ragrails[qdrant]`   | Set cloud URL and `QDRANT_API_KEY`.                             |
| Pinecone     | `pinecone`     | `ragrails[pinecone]` | Set `PINECONE_API_KEY`; index names cannot contain underscores. |
| Weaviate     | `weaviate`     | `ragrails[weaviate]` | Class names must be alphanumeric and start uppercase.           |

## Manual Pipeline

```python theme={null}
docs = rag.parse(files="files/refund-policy.pdf")
chunks = rag.chunk(markdown=docs.outputs)
embedded = rag.embed(chunks=chunks.items)
stored = rag.store(embedded_chunks=embedded.items)
```

<CardGroup cols={2}>
  <Card title="Embedding" icon="binary" href="/usage/sdk/embedding">Create embedded chunks.</Card>
  <Card title="Maintenance" icon="refresh-cw" href="/usage/sdk/knowledge-base-maintenance">Update or delete stored chunks.</Card>
</CardGroup>
