# Add files to existing vector store

**URL:** <https://community.openai.com/t/add-files-to-existing-vector-store/743801>\
**Category:** API\
**Tags:** vector-db, file-uploads, knowledge-files\
**Created:** [May 13, 2024, 9:55am UTC](https://community.openai.com/t/add-files-to-existing-vector-store/743801 "2024-05-13T09:55:45Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![alberto.tomas](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/alberto.tomas/32/164380_2.png) [@alberto.tomas](https://community.openai.com/u/alberto.tomas)\
**Post date:** [May 13, 2024, 9:55am UTC](https://community.openai.com/t/add-files-to-existing-vector-store/743801/1 "2024-05-13T09:55:45Z")

</div>

Hi,  
I want to add files to an existing vector store, instead of creating a new vector store each time.

Right now, as I understand from the [documentation](https://platform.openai.com/docs/assistants/tools/file-search/vector-stores) , the only way to add files to an existing vector store, is retrieving all the files\_ids from the vector store, add the files I want to that list of files, and create a new vector store, with ‘beta.vector\_stores.file\_batches.create\_and\_poll’, which seems a long process and I will have to keep deleting old versions of the vector store I want to keep…

Any better solutions? Thank you!

---

<div class="post-metadata">

**Author:** ![\_j](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/_j/32/766292_2.png) [@\_j](https://community.openai.com/u/_j)\
**Post date:** [May 13, 2024, 11:43am UTC](https://community.openai.com/t/add-files-to-existing-vector-store/743801/2 "2024-05-13T11:43:13Z")

</div>

[https://platform.openai.com/docs/api-reference/vector-stores-file-batches](https://platform.openai.com/docs/api-reference/vector-stores-file-batches)

```auto
from openai import OpenAI
import time
client = OpenAI()

batch_add = client.beta.vector_stores.file_batches.create(
  vector_store_id="vs_abc123",
  file_ids=["file-abc123", "file-abc456"]
)
time.sleep(1)
print(batch_add.status)

```

---

<div class="post-metadata">

**Author:** ![alberto.tomas](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/alberto.tomas/32/164380_2.png) [@alberto.tomas](https://community.openai.com/u/alberto.tomas)\
**Post date:** [May 20, 2024, 10:03am UTC](https://community.openai.com/t/add-files-to-existing-vector-store/743801/3 "2024-05-20T10:03:08Z")

</div>

And is there a reason why it should take more than an hour for 2 example text files with one character only? It has been ‘in\_progress’ for that long

---

<div class="post-metadata">

**Author:** ![MrFriday](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/mrfriday/32/350887_2.png) [@MrFriday](https://community.openai.com/u/MrFriday)\
**Post date:** [May 20, 2024, 11:35am UTC](https://community.openai.com/t/add-files-to-existing-vector-store/743801/4 "2024-05-20T11:35:19Z")

</div>

No, it’s not normal. Is it still in Progress?

---

<div class="post-metadata">

**Author:** ![alberto.tomas](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/alberto.tomas/32/164380_2.png) [@alberto.tomas](https://community.openai.com/u/alberto.tomas)\
**Post date:** [May 20, 2024, 12:14pm UTC](https://community.openai.com/t/add-files-to-existing-vector-store/743801/5 "2024-05-20T12:14:49Z")

</div>

Yes, and after retrieving it I get it has failed. I create the vector\_store:

```auto
vector_store = client.beta.vector_stores.create(name="Prueba Archivos-1")
# vector_store: VectorStore(id='vs_abc', created_at=1716207115, file_counts=FileCounts(cancelled=0, completed=0, failed=0, in_progress=0, total=0), last_active_at=1716207115, metadata={}, name='Name', object='vector_store', status='completed', usage_bytes=0, expires_after=None, expires_at=None)

```

And after running your code I get:

```auto
client.beta.vector_stores.file_batches.retrieve(batch_id = batch_add.id, vector_store_id= "vs_abc")
# VectorStoreFileBatch(id='vsfb_123', created_at=1716206526, file_counts=FileCounts(cancelled=0, completed=0, failed=2, in_progress=0, total=2), object='vector_store.file_batch', status='failed', vector_store_id='vs_abc')

```

---

<div class="post-metadata">

**Author:** ![alberto.tomas](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/alberto.tomas/32/164380_2.png) [@alberto.tomas](https://community.openai.com/u/alberto.tomas)\
**Post date:** [May 21, 2024, 7:47am UTC](https://community.openai.com/t/add-files-to-existing-vector-store/743801/6 "2024-05-21T07:47:14Z")

</div>

Okay the issue was that the files only had one caracter, so they were to short to be uploaded.

---

<div class="post-metadata">

**Author:** ![kaplan](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/kaplan/32/404075_2.png) [@kaplan](https://community.openai.com/u/kaplan)\
**Post date:** [June 18, 2024, 11:05am UTC](https://community.openai.com/t/add-files-to-existing-vector-store/743801/7 "2024-06-18T11:05:34Z")

</div>

How lucky I am to see Alberto’s post about too short.

While using `openai.beta.vectorStores.fileBatches.uploadAndPoll`, I was frustrated that the status of the request was `failed` but I was seeing the files in the vector store.

My only question is how could you find, the file size was the reason?

---

<div class="post-metadata">

**Author:** ![alberto.tomas](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/alberto.tomas/32/164380_2.png) [@alberto.tomas](https://community.openai.com/u/alberto.tomas)\
**Post date:** [July 2, 2024, 12:06pm UTC](https://community.openai.com/t/add-files-to-existing-vector-store/743801/8 "2024-07-02T12:06:55Z")

</div>

Hey! I’m happy to be helpfull.

I knew because I created files with just one or two characters, so I figured maybe it wasn’t enough.

---

<div class="post-metadata">

**Author:** ![CUR8-Developers](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/cur8-developers/32/273653_2.png) [@CUR8-Developers](https://community.openai.com/u/CUR8-Developers)\
**Post date:** [November 20, 2024, 1:47pm UTC](https://community.openai.com/t/add-files-to-existing-vector-store/743801/9 "2024-11-20T13:47:38Z")

</div>

> [@\_j](#):
>
> ```auto
> batch_add = client.beta.vector_stores.file_batches.create(
> vector_store_id="vs_abc123",
> file_ids=["file-abc123", "file-abc456"]
> )
> time.sleep(1)
> print(batch_add.status)
> 
> ```

Thanks buddy.i looking for it .Great Help ❤

---

<div class="post-metadata">

**Author:** ![CUR8-Developers](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/cur8-developers/32/273653_2.png) [@CUR8-Developers](https://community.openai.com/u/CUR8-Developers)\
**Post date:** [November 20, 2024, 1:48pm UTC](https://community.openai.com/t/add-files-to-existing-vector-store/743801/10 "2024-11-20T13:48:54Z")

</div>

exactly …same here wasted my 3 hr.lol thanks @alberto.tomas

---

<div class="post-metadata">

**Author:** ![muhammadali\_2003](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/muhammadali_2003/32/448291_2.png) [@muhammadali\_2003](https://community.openai.com/u/muhammadali_2003)\
**Post date:** [November 26, 2024, 5:16pm UTC](https://community.openai.com/t/add-files-to-existing-vector-store/743801/11 "2024-11-26T17:16:53Z")

</div>

hello Alberto. Just in case, have not come across a case of modifying already existing file batch. For example, there is already an existing file batch with 3 files. And i wanna add one more file to this existing file batch.

---

<div class="post-metadata">

**Author:** ![jrichter](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/jrichter/32/451425_2.png) [@jrichter](https://community.openai.com/u/jrichter)\
**Post date:** [December 9, 2024, 3:13pm UTC](https://community.openai.com/t/add-files-to-existing-vector-store/743801/12 "2024-12-09T15:13:53Z")

</div>

If I have all the files I want to attach to a vector store in my files area, is there a way to get a list of all those file\_ids?

Struggling to move these files from the files area to the vector store I want them in, and I can only seem to get an upload to work when I grab each file ID individually and create an array of them.

---

<div class="post-metadata">

**Author:** ![\_j](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/_j/32/766292_2.png) [@\_j](https://community.openai.com/u/_j)\
**Post date:** [December 9, 2024, 3:56pm UTC](https://community.openai.com/t/add-files-to-existing-vector-store/743801/13 "2024-12-09T15:56:47Z")

</div>

> [@jrichter](#):
>
> If I have all the files I want to attach to a vector store in my files area, is there a way to get a list of all those file\_ids

You can list all the files with “assistants” purpose. There’s an API method for that, returning 10000 at a time.

However, a typical organization will have tons of unrelated files, even just attachments to user messages. Your application database must keep track of the file IDs that you upload and connect to vector store, by Assistant intention or purpose.

There’s no bulk uploader of files, which could be convenient. Sending all the files individually as required, in parallel, could be a speedup, but only because of bandwidth allotted to a single connection.

---

<div class="post-metadata">

**Author:** ![\_j](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/_j/32/766292_2.png) [@\_j](https://community.openai.com/u/_j)\
**Post date:** [December 11, 2024, 2:42pm UTC](https://community.openai.com/t/add-files-to-existing-vector-store/743801/15 "2024-12-11T14:42:16Z")

</div>

The API endpoint call also needs the correct purpose, “assistants” (or the undocumented user-data purpose).

Then, the data is scoped by project and project of the API key.

---

<div class="post-metadata">

**Author:** ![Aditya\_D\_Naik](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/aditya_d_naik/32/694182_2.png) [@Aditya\_D\_Naik](https://community.openai.com/u/Aditya_D_Naik)\
**Post date:** [October 27, 2025, 12:06pm UTC](https://community.openai.com/t/add-files-to-existing-vector-store/743801/16 "2025-10-27T12:06:05Z")

</div>

Not even a joke how the response does literally nothing to tell you the text input was too short. Spent the entire morning trying to figure out this issue. Thanks a lot @alberto.tomas
