# Add to Vector Store

`Add_To_Vector_Store` stages GovTribe files into an OpenAI-backed vector store so you can run semantic chunk retrieval with `Search_Vector_Store`.

## Input Contract

* `items`: Files or file-bearing entities to ingest into a vector store.
  * `type`: `array<object>`
  * `required`: `yes`
  * `default`: `n/a`
  * `shape`: `[{"govtribe_type":"<string>","govtribe_id":"<string>"}]` with `1..10` items
  * `item_fields`: `govtribe_type` (string), `govtribe_id` (string)
  * `item_required`: both `govtribe_type` and `govtribe_id` are required for every item.
  * `item_notes`: `govtribe_type` selects an eligible file/entity source and `govtribe_id` must be a readable GovTribe ID.
* `govtribe_vector_store_id`: Existing vector store to append to; omit this field to create a new vector store owned by the caller in the active workspace.
  * `type`: `string|null`
  * `required`: `no`
  * `default`: `null`

## Output Contract

* Top-level keys:
  * `response`
* Row keys:
  * `n/a`
* Relationship retrieval map:
  * `govtribe_vector_store_id`
    * `tool`: `Search_Vector_Store`
    * `filter`: `govtribe_vector_store_id`
  * `file_govtribe_id` (when `govtribe_type_hint` indicates a user file)
    * `tool`: `Search_User_Files`
    * `filter`: `user_file_ids`
  * `file_govtribe_id` (when `govtribe_type_hint` indicates an external/government file)
    * `tool`: `Search_Government_Files`
    * `filter`: `government_file_ids`
    * `fallback`: if file type cannot be reliably inferred from the message line, try both tools with the same ID.

## Usage Patterns

Pattern A: Create a new vector store from one known external file. Tool: `Add_To_Vector_Store`

```json
{
  "items": [
    {
      "govtribe_type": "external_file_model",
      "govtribe_id": "<EXTERNAL_FILE_ID>"
    }
  ]
}
```

Pattern B: Append new files to an existing vector store. Tool: `Add_To_Vector_Store`

```json
{
  "govtribe_vector_store_id": "<VECTOR_STORE_ID>",
  "items": [
    {
      "govtribe_type": "user_file_model",
      "govtribe_id": "<USER_FILE_ID>"
    },
    {
      "govtribe_type": "pursuit_model",
      "govtribe_id": "<PURSUIT_ID>"
    }
  ]
}
```

Pattern C: Ingest contract context entities directly and let the tool resolve their attached files. Tool: `Add_To_Vector_Store`

```json
{
  "items": [
    {
      "govtribe_type": "federal_contract_opportunity_model",
      "govtribe_id": "<FEDERAL_CONTRACT_OPPORTUNITY_ID>"
    },
    {
      "govtribe_type": "federal_contract_i_d_v_model",
      "govtribe_id": "<FEDERAL_CONTRACT_IDV_ID>"
    }
  ]
}
```
