# Search Vector Store

`Search_Vector_Store` runs semantic chunk retrieval against an existing GovTribe vector store and returns a plain-text answer payload, not a paginated dataset envelope.

## Input Contract

* `govtribe_vector_store_id`: GovTribe vector store identifier to search.
  * `type`: `string`
  * `required`: `yes`
  * `default`: `n/a`
* `query`: Natural-language search prompt used to retrieve relevant chunks.
  * `type`: `string`
  * `required`: `yes`
  * `default`: `n/a`
* `max_num_results`: Upper bound on returned matches; keep this as small as possible for the user question.
  * `type`: `number` (integer range)
  * `required`: `no`
  * `default`: `10` (schema default; handler fallback is `3` when omitted)
  * `shape`: integer in `[1, 50]`
* `rewrite_query`: Optional rewrite toggle that lets the search layer reformulate the prompt for better semantic recall.
  * `type`: `boolean`
  * `required`: `no`
  * `default`: `n/a`

Use concise, intent-rich `query` strings and a tight `max_num_results` to reduce noise. Keep `rewrite_query` off when the caller already supplies a carefully phrased requirement string, and enable it when the user asks broad conceptual questions with varied wording.

## Output Contract

* Top-level keys:
  * `text_response`: single formatted text block returned by the tool call.
  * `result_summary`: first line reports either `Found N result(s) for: "<query>"` or `No results found for: "<query>"`.
  * `additional_results_note`: optional trailing note when more matches are available beyond returned entries.
* Row keys:
  * `rank`
  * `filename`
  * `relevance_percent`
  * `attributes`
  * `content_chunks`
* Relationship retrieval map:
  * `attributes.govtribe_id` with file-model attributes for workspace files
    * `tool`: `Search_User_Files`
    * `filter`: `user_file_ids`
  * `attributes.govtribe_id` with file-model attributes for government files
    * `tool`: `Search_Government_Files`
    * `filter`: `government_file_ids`
  * `filename` when ID attributes are absent
    * `tool`: `Search_User_Files`
    * `filter`: `query`
    * `fallback`: If the corpus is government-file based, use `Search_Government_Files` with `query` on the same filename phrase.

## Usage Patterns

Pattern A: Focused requirement extraction from a known store. Tool: `Search_Vector_Store`

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

Pattern B: Concept-level discovery with query rewriting enabled. Tool: `Search_Vector_Store`

```json
{
  "govtribe_vector_store_id": "<VECTOR_STORE_ID>",
  "query": "Summarize cybersecurity incident response expectations and timelines.",
  "max_num_results": 8,
  "rewrite_query": false
}
```

Pattern C: Quick triage pass to verify relevant evidence exists before deeper follow-up. Tool: `Search_Vector_Store`

```json
{
  "govtribe_vector_store_id": "<VECTOR_STORE_ID>",
  "query": "What are the key staffing qualifications and certifications?",
  "max_num_results": 3
}
```
