> For the complete documentation index, see [llms.txt](https://docs.airops.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.airops.com/api-reference-1/memory-stores.md).

# Memory Stores

Endpoints for managing memory stores (vector stores) and document search.

## Search

> Perform a search on a memory store.

```json
{"openapi":"3.0.1","info":{"title":"API V1","version":"v1"},"tags":[{"name":"Memory Stores","description":"Endpoints for managing memory stores (vector stores) and document search."}],"servers":[{"url":"https://api.airops.com","variables":{"defaultHost":{"default":"api.airops.com"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}},"parameters":{"memory_store_id":{"name":"memory_store_id","in":"path","required":true,"schema":{"type":"string"},"description":"The Memory Store id"}},"schemas":{"MemoryStoreSearchResultItem":{"type":"object","properties":{"id":{"type":"string"},"score":{"type":"number"},"content":{"type":"string"},"document_name":{"type":"string"},"metadata":{"type":"object"}},"required":["id","score","content","document_name","metadata"]}}},"paths":{"/public_api/vector_stores/{memory_store_id}/search":{"get":{"summary":"Search","description":"Perform a search on a memory store.","tags":["Memory Stores"],"operationId":"searchMemoryStore","parameters":[{"$ref":"#/components/parameters/memory_store_id","description":"The Memory Store id"},{"name":"query","in":"query","required":true,"schema":{"type":"string"},"description":"The query to search for"},{"name":"topk","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":1000},"description":"The number of results to return"},{"name":"filter","in":"query","required":false,"schema":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}},"description":"The filter to apply to the search. See https://docs.airops.com/basic-setup/memory-stores/memory-stores-metadata#how-to-filter-on-metadata for more information."}],"responses":{"200":{"description":"Results found","content":{"application/json":{"schema":{"type":"object","properties":{"matches":{"type":"array","items":{"$ref":"#/components/schemas/MemoryStoreSearchResultItem"}}}}}}},"400":{"description":"Invalid Request"},"401":{"description":"Authentication error"}}}}}}
```

## Add Document

> Add a document to a memory store.

```json
{"openapi":"3.0.1","info":{"title":"API V1","version":"v1"},"tags":[{"name":"Memory Stores","description":"Endpoints for managing memory stores (vector stores) and document search."}],"servers":[{"url":"https://api.airops.com","variables":{"defaultHost":{"default":"api.airops.com"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}},"parameters":{"memory_store_id":{"name":"memory_store_id","in":"path","required":true,"schema":{"type":"string"},"description":"The Memory Store id"}},"schemas":{"MemoryStoreDocument":{"type":"object","properties":{"id":{"type":"number"},"document_type":{"type":"string"},"name":{"type":"string"},"source":{"type":"string"},"status":{"type":"string"},"sync_progress_percentage":{"type":"number"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"vector_store_id":{"type":"number"}}}}},"paths":{"/public_api/vector_stores/{memory_store_id}/vector_store_documents":{"post":{"summary":"Add Document","description":"Add a document to a memory store.","tags":["Memory Stores"],"operationId":"addDocumentToMemoryStore","parameters":[{"$ref":"#/components/parameters/memory_store_id","description":"The Memory Store id"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","description":"The content of the document"},"name":{"type":"string","description":"The name of the document"},"metadata":{"type":"object","description":"The metadata of the document"}},"required":["name","text"]}}}},"responses":{"200":{"description":"Document added","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryStoreDocument"}}}},"400":{"description":"Invalid Request"},"401":{"description":"Authentication error"}}}}}}
```

## Update Document

> Update a document in a memory store.

```json
{"openapi":"3.0.1","info":{"title":"API V1","version":"v1"},"tags":[{"name":"Memory Stores","description":"Endpoints for managing memory stores (vector stores) and document search."}],"servers":[{"url":"https://api.airops.com","variables":{"defaultHost":{"default":"api.airops.com"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}},"parameters":{"memory_store_id":{"name":"memory_store_id","in":"path","required":true,"schema":{"type":"string"},"description":"The Memory Store id"},"memory_store_document_id":{"name":"memory_store_document_id","in":"path","required":true,"schema":{"type":"string"}}},"schemas":{"MemoryStoreDocument":{"type":"object","properties":{"id":{"type":"number"},"document_type":{"type":"string"},"name":{"type":"string"},"source":{"type":"string"},"status":{"type":"string"},"sync_progress_percentage":{"type":"number"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"vector_store_id":{"type":"number"}}}}},"paths":{"/public_api/vector_stores/{memory_store_id}/vector_store_documents/{memory_store_document_id}":{"put":{"summary":"Update Document","description":"Update a document in a memory store.","tags":["Memory Stores"],"operationId":"updateDocumentInMemoryStore","parameters":[{"$ref":"#/components/parameters/memory_store_id","description":"The Memory Store id"},{"$ref":"#/components/parameters/memory_store_document_id","description":"The id of the document to update"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","description":"The content of the document"},"name":{"type":"string","description":"The name of the document"},"metadata":{"type":"object","description":"The metadata of the document"}},"required":["name","text"]}}}},"responses":{"200":{"description":"Document updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryStoreDocument"}}}},"401":{"description":"Authentication error"}}}}}}
```

## Delete Document

> Delete a document from a memory store.

```json
{"openapi":"3.0.1","info":{"title":"API V1","version":"v1"},"tags":[{"name":"Memory Stores","description":"Endpoints for managing memory stores (vector stores) and document search."}],"servers":[{"url":"https://api.airops.com","variables":{"defaultHost":{"default":"api.airops.com"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}},"parameters":{"memory_store_id":{"name":"memory_store_id","in":"path","required":true,"schema":{"type":"string"},"description":"The Memory Store id"},"memory_store_document_id":{"name":"memory_store_document_id","in":"path","required":true,"schema":{"type":"string"}}}},"paths":{"/public_api/vector_stores/{memory_store_id}/vector_store_documents/{memory_store_document_id}":{"delete":{"summary":"Delete Document","description":"Delete a document from a memory store.","tags":["Memory Stores"],"operationId":"deleteDocumentFromMemoryStore","parameters":[{"$ref":"#/components/parameters/memory_store_id","description":"The Memory Store id"},{"$ref":"#/components/parameters/memory_store_document_id","description":"The id of the document to delete"}],"responses":{"200":{"description":"Document deleted"},"401":{"description":"Authentication error"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.airops.com/api-reference-1/memory-stores.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
