# Vector\_Store\_Content\_Retrieval\_Guide

## Purpose

Use this guide to retrieve file content semantically with GovTribe MCP vector-store tools when metadata search is not enough. This is for government + user files uploaded via `Add_To_Vector_Store`, not a GovTribe knowledge base. Use it when:

* users ask content-level questions about attached files.
* keyword matching over metadata is weak.
* you need semantic chunk retrieval from file text.

## Workflow

1. Resolve input scope for vector ingestion.
   * Use only `govtribe_type` values allowed by the current `Add_To_Vector_Store` schema.
   * Use canonical values like `government_file`, `user_file`, `pursuit`, or `federal_contract_opportunity`, not legacy `_model` strings.
   * If a target entity type is unsupported, fall back to `Search_*` metadata tools or request a supported `govtribe_id`/`govtribe_type`.
2. Call `Add_To_Vector_Store`.
   * If you already have a reusable `govtribe_vector_store_id`, pass it so new files are appended to that store.
   * Capture the returned `govtribe_vector_store_id` for later polling or retrieval.
3. Inspect the returned `status`.
   * If `status` is `in_progress`, do not assume retrieval is ready yet.
   * Call `Add_To_Vector_Store` again later with the same arguments to poll status.
   * If `status` is `failed`, do not assume the requested files are ready for vector-store retrieval.
4. Only move to retrieval after `Add_To_Vector_Store` returns `completed`.
   * `Search_Vector_Store` is safe once the add tool reports `completed`.
   * Before `completed`, do not assume the requested files are indexed and queryable yet.
5. Call `Search_Vector_Store` with a focused content question.
   * Keep `max_num_results` as small as needed to answer the request.
   * Use `rewrite_query` only when the user intent benefits from query rephrasing.
6. Treat returned chunks as semantic evidence, not full-document exact-match output.

## Examples

Create and query a vector store sequence. Start ingestion for one government file. Step 1 Tool: `Add_To_Vector_Store`

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

If the tool returns `status: "in_progress"`, poll with the same arguments later. Step 2 Tool: `Add_To_Vector_Store`

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

Once the tool returns `status: "completed"`, search the resulting vector store for requirements. Step 3 Tool: `Search_Vector_Store`

```json
{
  "query": "Summarize cyber incident response requirements and deadlines.",
  "govtribe_vector_store_id": "<VECTOR_STORE_ID>",
  "max_num_results": 10,
  "rewrite_query": true
}
```

Reuse an existing completed store with tighter result count. Tool: `Search_Vector_Store`

```json
{
  "query": "List mandatory deliverables and submission format instructions.",
  "govtribe_vector_store_id": "<VECTOR_STORE_ID>",
  "max_num_results": 5,
  "rewrite_query": false
}
```


---

# 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/guides/vector_store_content_retrieval_guide.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.
