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

# Create Datastore

> Create a new datastore to organize your documents or databases.

### Body Parameters

<ParamField body="name" type="string" required>
  The name of the datastore. This helps you identify and organize your data.
</ParamField>

<ParamField body="type" type="string" required>
  The type of datastore to create. Supported values: - `database` - For
  structured database content - `documents` - For document files
</ParamField>

<ParamField body="metadata" type="object" optional>
  The metadata for the datastore. This is only required for `database` type datastores. Set the connection string for the database.

  ```json theme={null}
  {
    "metadata": {
      "connectionString": "postgresql://username:password@host:port/database"
    }
  }
  ```
</ParamField>

### Response

Returns the created datastore information including the datastore ID.

```json theme={null}
{
  "datastore_id": "ds_1234567890abcdef",
  "name": "My Documents",
  "type": "documents",
  "created_at": "2025-10-01T12:00:00Z"
}
```

### Response Fields

<ResponseField name="datastore_id" type="string">
  The unique identifier for the created datastore. Use this ID when indexing
  documents.
</ResponseField>

<ResponseField name="name" type="string">
  The name of the datastore
</ResponseField>

<ResponseField name="type" type="string">
  The type of datastore (`database` or `documents`)
</ResponseField>

<ResponseField name="created_at" type="string">
  Timestamp of when the datastore was created
</ResponseField>
