# Add to Vector Store

`Add_To_Vector_Store` stages GovTribe files into an OpenAI-backed vector store so you can retrieve file content later with `Search_Vector_Store` or hosted `file_search`.

This tool is a `start-or-status` operation. It returns quickly with a terminal result describing whether the requested files are still processing, ready, or failed. Repeated calls with the same arguments act as status checks and do not redispatch duplicate upload work.

## Output Contract

* Top-level keys:
  * `status`: `in_progress | completed | failed`
  * `message`
  * `govtribe_vector_store_id`
  * `oai_vector_store_id`
  * `requested_file_count`
  * `completed_file_count`
  * `pending_file_count`
  * `failed_file_count`
  * `hosted_tool_ready`
  * `retry_with_same_arguments`
* Status semantics:
  * `in_progress`: requested files are still attaching or indexing. Call `Add_To_Vector_Store` again later with the same arguments.
  * `completed`: requested files are ready for `Search_Vector_Store`. Hosted `file_search` may still appear only on a later turn.
  * `failed`: some requested files failed to become ready. Status polling does not auto-retry failed files.
* Relationship retrieval map:
  * `govtribe_vector_store_id`
    * `tool`: `Search_Vector_Store`
    * `filter`: `govtribe_vector_store_id`
  * `govtribe_vector_store_id`
    * `hosted_tool`: `file_search`
    * `availability`: only when `hosted_tool_ready` is `true`, and possibly only on a later turn

## Usage Patterns

Pattern A: Start ingestion for a new vector store from one known government file. Tool: `Add_To_Vector_Store`

```json
{
  "items": [
    {
      "govtribe_type": "government_file",
      "govtribe_id": "<GOVERNMENT_FILE_ID>"
    }
  ]
}
```

Typical response while work is still running:

```json
{
  "status": "in_progress",
  "message": "Vector store <VECTOR_STORE_ID> has 1 requested supported file(s): 0 completed, 1 pending, 0 failed. Files are still attaching or indexing. Call Add_To_Vector_Store again later with the same arguments to check status.",
  "govtribe_vector_store_id": "<VECTOR_STORE_ID>",
  "oai_vector_store_id": "<OAI_VECTOR_STORE_ID>",
  "requested_file_count": 1,
  "completed_file_count": 0,
  "pending_file_count": 1,
  "failed_file_count": 0,
  "hosted_tool_ready": false,
  "retry_with_same_arguments": true
}
```

Pattern B: Poll the same request later with the same arguments. Tool: `Add_To_Vector_Store`

```json
{
  "items": [
    {
      "govtribe_type": "government_file",
      "govtribe_id": "<GOVERNMENT_FILE_ID>"
    }
  ]
}
```

Typical completed response:

```json
{
  "status": "completed",
  "message": "Vector store <VECTOR_STORE_ID> has 1 requested supported file(s): 1 completed, 0 pending, 0 failed. Requested files are ready for Search_Vector_Store. Hosted file_search may become available on a later turn.",
  "govtribe_vector_store_id": "<VECTOR_STORE_ID>",
  "oai_vector_store_id": "<OAI_VECTOR_STORE_ID>",
  "requested_file_count": 1,
  "completed_file_count": 1,
  "pending_file_count": 0,
  "failed_file_count": 0,
  "hosted_tool_ready": true,
  "retry_with_same_arguments": false
}
```

Pattern C: Append additional files or file-bearing entities to an existing vector store. Tool: `Add_To_Vector_Store`

```json
{
  "govtribe_vector_store_id": "<VECTOR_STORE_ID>",
  "items": [
    {
      "govtribe_type": "user_file",
      "govtribe_id": "<USER_FILE_ID>"
    },
    {
      "govtribe_type": "pursuit",
      "govtribe_id": "<PURSUIT_ID>"
    },
    {
      "govtribe_type": "federal_contract_opportunity",
      "govtribe_id": "<FEDERAL_CONTRACT_OPPORTUNITY_ID>"
    }
  ]
}
```

Common `govtribe_type` values include `government_file`, `user_file`, `pursuit`, `federal_contract_opportunity`, `federal_contract_idv`, and, when enabled for the workspace, state/local contract entity types. Always follow the current tool schema for the allowed set.


---

# 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.govtribe.com/user-guide/mcp/tools/add-to-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.
