# 벡터 저장소에 새 텍스트 문서 추가

{% openapi src="/files/fAmF2Kwil50sF5cXMoEX" path="/vector-stores/{vector-store-id}/documents/create" method="post" %}
[rememberizer\_openapi.yml](https://2913883985-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fs0e4JCKQXzEGPRlMO7nt%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media\&token=ac0eeb18-73cf-42a3-93fe-2ff232a978a3)
{% endopenapi %}

## 예제 요청

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X POST \
  https://api.rememberizer.ai/api/v1/vector-stores/vs_abc123/documents/create \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "제품 개요",
    "text": "우리 제품은 벡터 임베딩 관리를 위한 혁신적인 솔루션입니다. 기존 시스템과의 원활한 통합을 제공하며 강력한 의미 검색 기능을 제공합니다."
  }'
```

{% hint style="info" %}
`YOUR_API_KEY`를 실제 벡터 스토어 API 키로 교체하고 `vs_abc123`를 벡터 스토어 ID로 교체하세요.
{% endhint %}
{% endtab %}

{% tab title="JavaScript" %}

```javascript
const addTextDocument = async (vectorStoreId, name, text) => {
  const response = await fetch(`https://api.rememberizer.ai/api/v1/vector-stores/${vectorStoreId}/documents/create`, {
    method: 'POST',
    headers: {
      'x-api-key': 'YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: name,
      text: text
    })
  });
  
  const data = await response.json();
  console.log(data);
};

addTextDocument(
  'vs_abc123',
  '제품 개요',
  '우리 제품은 벡터 임베딩 관리를 위한 혁신적인 솔루션입니다. 기존 시스템과의 원활한 통합을 제공하며 강력한 의미 검색 기능을 제공합니다.'
);
```

{% hint style="info" %}
`YOUR_API_KEY`를 실제 벡터 스토어 API 키로 교체하고 `vs_abc123`를 벡터 스토어 ID로 교체하세요.
{% endhint %}
{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

def add_text_document(vector_store_id, name, text):
    headers = {
        "x-api-key": "YOUR_API_KEY",
        "Content-Type": "application/json"
    }
    
    payload = {
        "name": name,
        "text": text
    }
    
    response = requests.post(
        f"https://api.rememberizer.ai/api/v1/vector-stores/{vector_store_id}/documents/create",
        headers=headers,
        data=json.dumps(payload)
    )
    
    data = response.json()
    print(data)

add_text_document(
    'vs_abc123',
    '제품 개요',
    '우리 제품은 벡터 임베딩 관리를 위한 혁신적인 솔루션입니다. 기존 시스템과의 원활한 통합을 제공하며 강력한 의미 검색 기능을 제공합니다.'
)
```

{% hint style="info" %}
`YOUR_API_KEY`를 실제 벡터 스토어 API 키로 교체하고 `vs_abc123`를 벡터 스토어 ID로 교체하세요.
{% endhint %}
{% endtab %}
{% endtabs %}

## 경로 매개변수

| 매개변수            | 유형  | 설명                             |
| --------------- | --- | ------------------------------ |
| vector-store-id | 문자열 | **필수.** 문서를 추가할 벡터 저장소의 ID입니다. |

## 요청 본문

```json
{
  "name": "제품 개요",
  "text": "우리 제품은 벡터 임베딩 관리를 위한 혁신적인 솔루션입니다. 기존 시스템과의 원활한 통합을 제공하며 강력한 의미 기반 검색 기능을 제공합니다."
}
```

| 매개변수 | 유형  | 설명                     |
| ---- | --- | ---------------------- |
| name | 문자열 | **필수.** 문서의 이름입니다.     |
| text | 문자열 | **필수.** 문서의 텍스트 내용입니다. |

## 응답 형식

```json
{
  "id": 1234,
  "name": "제품 개요",
  "type": "text/plain",
  "vector_store": "vs_abc123",
  "size": 173,
  "status": "처리 중",
  "processing_status": "대기 중",
  "indexed_on": null,
  "status_error_message": null,
  "created": "2023-06-15T10:15:00Z",
  "modified": "2023-06-15T10:15:00Z"
}
```

## 인증

이 엔드포인트는 `x-api-key` 헤더에 API 키를 사용하여 인증이 필요합니다.

## 오류 응답

| 상태 코드 | 설명                          |
| ----- | --------------------------- |
| 400   | 잘못된 요청 - 필수 필드 누락 또는 잘못된 형식 |
| 401   | 인증되지 않음 - 잘못되었거나 누락된 API 키  |
| 404   | 찾을 수 없음 - 벡터 저장소를 찾을 수 없음   |
| 500   | 내부 서버 오류                    |

이 엔드포인트를 사용하면 텍스트 콘텐츠를 벡터 저장소에 직접 추가할 수 있습니다. 이는 제품 설명, 지식 기반 기사 또는 사용자 정의 콘텐츠와 같이 파일 형식으로 존재하지 않을 수 있는 정보를 저장하는 데 특히 유용합니다. 텍스트는 자동으로 벡터 임베딩으로 처리되어 의미적 유사성을 사용하여 검색할 수 있게 됩니다.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.rememberizer.ai/ko/undefined-1/api-docs/vector-store/add-new-text-document-to-a-vector-store.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
