# Containers (/docs/docklee/containers)
Knowledge has to be processed before an engine can search it. A container is where that happens. Every piece of knowledge, from a connected source or from `Dock`, lands in a container, and engines read it from there.

There are two kinds of container.

| | Vector | OKF |
| --- | --- | --- |
| Stores | Chunks and their embeddings | Concepts and the links between them |
| Searches by | Meaning | Keywords and links between concepts |
| Dimension | Yes, one per container | None |
| Good for | Long documents, help centers, mixed content | Catalogs, policies, and wikis with clear concepts |

## Vector containers [#vector-containers]

<Callout type="info" title="Use a vector container when...">
- Questions use different words than your content.
- The content is long or loosely structured.
</Callout>

A vector container splits content into chunks, extracts its structure, and embeds each chunk at a fixed dimension. The dimension is the length of each embedding.

| Supported dimensions |
| --- |
| `256`, `512`, `768`, `1024`, `1536`, `3072`, `4096` |

Your plan sets which dimensions you can enable, and a write can only use a dimension that's enabled for your workspace. Higher dimensions capture more detail and use more storage.

<Callout type="warn">
If you leave the dimension out, Docklee uses your workspace default. An engine reads vector sources of one dimension only, so pick one per engine and keep to it.
</Callout>

## OKF containers [#okf-containers]

<Callout type="info" title="Use an OKF container when...">
- Your knowledge has clear concepts and relationships.
- Following links between ideas matters as much as matching words.
</Callout>

An OKF container stores knowledge in the Open Knowledge Format, an open specification where each concept is a Markdown file and links between files form a graph. Docklee builds the concepts and their links from your content. No embeddings are used, so an OKF container has no dimension. See [What is OKF](/docs/okf/what-is-okf).

## Declare a container on a write [#declare-a-container-on-a-write]

A `Dock` write declares the container, never an engine:

<CodeTabs>
  <Tab value="Python">
    ```python
    from docklee import Dock

    vector_dock = Dock(container="vector", dimension=1024)
    okf_dock = Dock(container="okf")

    vector_dock.capture("Refunds are available within 30 days.", type="knowledge")
    okf_dock.capture("Every Atlas desk has a 5-year warranty.", type="knowledge")

    vector_dock.flush_sync()
    okf_dock.flush_sync()
    ```
  </Tab>
  <Tab value="TypeScript">
    ```ts
    import { Dock } from 'docklee';

    const vectorDock = new Dock({ container: 'vector', dimension: 1024 });
    const okfDock = new Dock({ container: 'okf' });

    vectorDock.capture('Refunds are available within 30 days.', { type: 'knowledge' });
    okfDock.capture('Every Atlas desk has a 5-year warranty.', { type: 'knowledge' });

    await Promise.all([vectorDock.close(), okfDock.close()]);
    ```
  </Tab>
  <Tab value="cURL">
    ```bash
    curl https://api.docklee.com/v1/dock/ingest \
      -H "Authorization: Bearer $DOCKLEE_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "container": "okf",
        "events": [
          {"content": "Every Atlas desk has a 5-year warranty.", "type": "knowledge"}
        ]
      }'
    ```
  </Tab>
</CodeTabs>

To set the container once for every `Dock`, use environment variables:

```bash
export DOCKLEE_CONTAINER="vector"
export DOCKLEE_DIMENSION="1024"
```

| Field | Values | Notes |
| --- | --- | --- |
| `container` | `vector` or `okf` | Any other value is rejected. |
| `dimension` | An enabled dimension | Vector only. Leave it out to use your workspace default. A dimension that isn't enabled is rejected. |

## The API/SDK Feed source [#the-apisdk-feed-source]

The first write to a container creates an **API/SDK Feed** source for it in **Sources**. Later writes to the same container, and for vector the same dimension, go to that same feed.

No engine reads a feed until you link it. A write can never change an engine's answers before you decide it should.

## Next steps [#next-steps]

Your writes now land in a container. Link the feed to an engine to start reading from it.

<Cards>
  <Card title="Engines" href="/docs/docklee/engines" description="Link a feed or a source to an engine." />
  <Card title="Sources" href="/docs/docklee/sources" description="Every source, connected or written, in one library." />
  <Card title="How Docklee works" href="/docs/docklee/how-docklee-works" description="How a write is routed." />
</Cards>
