# Vector\_Store\_Content\_Retrieval\_Guide

## Purpose

Use this guide to retrieve file content semantically with GovTribe vector-store tools when metadata search is not enough. 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.
   * 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` when no reusable store ID is available.
   * Capture and persist the returned `govtribe_vector_store_id`.
3. Reuse an existing `govtribe_vector_store_id` when one is already available for the same corpus.
4. 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.
5. Treat returned chunks as semantic evidence, not full-document exact-match output.

## Examples

Create and query a vector store sequence: Ingest one external file into a vector store: Step 1 Tool: `Add_To_Vector_Store`

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

Search the resulting vector store for requirements: Step 2 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 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
}
```
