openai · OpenAI Platform Docs
Retrieval | OpenAI API
Explains how to implement the retrieval mechanism to allow models to access and query external knowledge bases or private datasets.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Retrieval | OpenAI API
Explains how to implement the retrieval mechanism to allow models to access and query external knowledge bases or private datasets.
When To Use
Use when you need to implement a workflow that enables an AI model to search through and retrieve information from specific documents or external data sources.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/retrieval-openai-api-workflow-guide.md | A guide explaining how to perform semantic search and query rewriting using the OpenAI Retrieval API. | Questions about a guide explaining how to perform semantic search and query rewriting using the OpenAI Retrieval API. |
examples/retrieval-openai-api-openai-api-python-vectorstore-create-and-upload.text | A Python script using the OpenAI client to create a vector store and upload a file to it. | Exact payloads, commands, or snippets shown in A Python script using the OpenAI client to create a vector store and upload a file to it. |
examples/retrieval-openai-api-openai-api-vectorstore-create-and-upload-nodejs.text | A Node.js code example demonstrating how to create a vector store and upload a file to it using the OpenAI client. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to create a vector store and upload a file to it using the OpenAI client. |
examples/retrieval-openai-api-openai-api-vectorstore-search-python.text | A Python code snippet demonstrating how to use the OpenAI client to search a vector store with a user query. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to use the OpenAI client to search a vector store with a user query. |
examples/retrieval-openai-api-openai-api-vectorstores-search-nodejs.text | A JavaScript code snippet demonstrating how to use the OpenAI client to search a vector store with a user query. | Exact payloads, commands, or snippets shown in A JavaScript code snippet demonstrating how to use the OpenAI client to search a vector store with a user query. |
examples/retrieval-openai-api-openai-api-vectorstores-search-python.text | A Python code snippet demonstrating how to search a vector store using the OpenAI client to retrieve relevant results for a query. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to search a vector store using the OpenAI client to retrieve relevant results... |
examples/retrieval-openai-api-openai-api-vectorstores-search-javascript.text | A JavaScript code example demonstrating how to use the vector stores search method to query a vector store using a text query. | Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to use the vector stores search method to query a vector store using a te... |
examples/retrieval-openai-api-openai-api-retrieval-vectorstore-search-results.text | A sample JSON object representing the structure of search results returned from a vector store search query. | Exact payloads, commands, or snippets shown in A sample JSON object representing the structure of search results returned from a vector store search query. |
examples/retrieval-openai-api-openai-api-retrieval-query-operators.text | A text example demonstrating comparison operators and attribute key-value structures used for retrieval queries in the OpenAI API. | Exact payloads, commands, or snippets shown in A text example demonstrating comparison operators and attribute key-value structures used for retrieval queries in th... |
examples/retrieval-openai-api-openai-api-retrieval-logical-operators.text | A text example demonstrating the use of logical operators and filters for retrieval operations in the OpenAI API. | Exact payloads, commands, or snippets shown in A text example demonstrating the use of logical operators and filters for retrieval operations in the OpenAI API. |
examples/retrieval-openai-api-openai-api-retrieval-query-filter.text | A text example demonstrating the structure of a query filter object used in the OpenAI Retrieval API. | Exact payloads, commands, or snippets shown in A text example demonstrating the structure of a query filter object used in the OpenAI Retrieval API. |
examples/retrieval-openai-api-openai-api-retrieval-filter-logic.text | A text representation of logical filter structures using type, key, and value pairs for OpenAI API retrieval operations. | Exact payloads, commands, or snippets shown in A text representation of logical filter structures using type, key, and value pairs for OpenAI API retrieval operations. |
examples/retrieval-openai-api-openai-api-retrieval-files.text | A collection of text files used to demonstrate the retrieval functionality within the OpenAI API. | Exact payloads, commands, or snippets shown in A collection of text files used to demonstrate the retrieval functionality within the OpenAI API. |
examples/retrieval-openai-api-openai-api-retrieval-metadata.text | A text representation of file metadata objects including filename and type properties used in the OpenAI Retrieval API. | Exact payloads, commands, or snippets shown in A text representation of file metadata objects including filename and type properties used in the OpenAI Retrieval API. |
examples/retrieval-openai-api-openai-api-retrieval-filter-query.text | A text representation of a complex logical filter query used for retrieving specific data points within the OpenAI API. | Exact payloads, commands, or snippets shown in A text representation of a complex logical filter query used for retrieving specific data points within the OpenAI API. |
examples/retrieval-openai-api-openai-api-vectorstore-create-python.text | A Python code snippet demonstrating how to create a vector store using the OpenAI client. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to create a vector store using the OpenAI client. |
examples/retrieval-openai-api-openai-api-vectorstore-create-nodejs.text | A Node.js code snippet demonstrating how to create a vector store using the OpenAI API client. | Exact payloads, commands, or snippets shown in A Node.js code snippet demonstrating how to create a vector store using the OpenAI API client. |
examples/retrieval-openai-api-openai-api-vectorstore-retrieve-python.text | A Python code snippet demonstrating how to retrieve a specific vector store using the OpenAI client. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to retrieve a specific vector store using the OpenAI client. |
examples/retrieval-openai-api-openai-api-vectorstore-retrieve-nodejs.text | A JavaScript code snippet demonstrating how to retrieve a specific vector store using the OpenAI client library. | Exact payloads, commands, or snippets shown in A JavaScript code snippet demonstrating how to retrieve a specific vector store using the OpenAI client library. |
examples/retrieval-openai-api-openai-api-vectorstore-update-python.text | A Python code snippet demonstrating how to update a vector store name using the OpenAI client. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to update a vector store name using the OpenAI client. |
examples/retrieval-openai-api-openai-api-vectorstore-update-nodejs.text | A Node.js code snippet demonstrating how to update a vector store name using the OpenAI client. | Exact payloads, commands, or snippets shown in A Node.js code snippet demonstrating how to update a vector store name using the OpenAI client. |
examples/retrieval-openai-api-openai-api-vectorstore-delete.text | A Python code snippet demonstrating how to delete a specific vector store using the OpenAI client. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to delete a specific vector store using the OpenAI client. |
examples/retrieval-openai-api-openai-api-vectorstore-delete-nodejs.text | A Node.js code snippet demonstrating how to delete a specific vector store using the OpenAI client. | Exact payloads, commands, or snippets shown in A Node.js code snippet demonstrating how to delete a specific vector store using the OpenAI client. |
examples/retrieval-openai-api-openai-api-vector-stores-list-python.text | A Python code example demonstrating how to use the OpenAI client to list existing vector stores. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the OpenAI client to list existing vector stores. |
examples/retrieval-openai-api-openai-api-vector-stores-list-nodejs.text | A Node.js code example demonstrating how to list vector stores using the OpenAI API client. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to list vector stores using the OpenAI API client. |
examples/retrieval-openai-api-openai-api-vectorstores-files-createandpoll-python.text | A Python code snippet demonstrating how to create and poll a file within a vector store using the OpenAI API client. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to create and poll a file within a vector store using the OpenAI API client. |
examples/retrieval-openai-api-openai-api-vectorstore-create-and-poll-nodejs.text | A Node.js code snippet demonstrating how to add a file to an existing vector store using the createAndPoll method. | Exact payloads, commands, or snippets shown in A Node.js code snippet demonstrating how to add a file to an existing vector store using the createAndPoll method. |
examples/retrieval-openai-api-openai-api-vectorstore-upload-python.text | A Python code snippet demonstrating how to upload a file to an OpenAI vector store using the upload_and_poll method. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to upload a file to an OpenAI vector store using the uploadandpoll method. |
examples/retrieval-openai-api-openai-api-vectorstore-upload-nodejs.text | A Node.js code snippet demonstrating how to upload a file to an existing OpenAI vector store using the uploadAndPoll method. | Exact payloads, commands, or snippets shown in A Node.js code snippet demonstrating how to upload a file to an existing OpenAI vector store using the uploadAndPoll... |
examples/retrieval-openai-api-openai-api-vectorstores-files-retrieve-python.text | A Python code snippet demonstrating how to retrieve a specific file from a vector store using the OpenAI API client. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to retrieve a specific file from a vector store using the OpenAI API client. |
examples/retrieval-openai-api-openai-api-vectorstores-files-retrieve-nodejs.text | A Node.js code example demonstrating how to retrieve a specific file from a vector store using the OpenAI API client. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to retrieve a specific file from a vector store using the OpenAI API client. |
examples/retrieval-openai-api-openai-api-vectorstore-update-python-2.text | A Python code snippet demonstrating how to update file attributes within a vector store using the OpenAI API client. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to update file attributes within a vector store using the OpenAI API client. |
examples/retrieval-openai-api-openai-api-vectorstore-update-nodejs-2.text | A Node.js code snippet demonstrating how to update a file within a vector store using the OpenAI API client. | Exact payloads, commands, or snippets shown in A Node.js code snippet demonstrating how to update a file within a vector store using the OpenAI API client. |
examples/retrieval-openai-api-openai-api-vectorstore-delete-2.text | A Python code snippet demonstrating how to delete a specific file from an OpenAI vector store using the client library. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to delete a specific file from an OpenAI vector store using the client library. |
examples/retrieval-openai-api-openai-api-vectorstore-delete-nodejs-2.text | A Node.js code snippet demonstrating how to delete a specific file from an OpenAI vector store using the client library. | Exact payloads, commands, or snippets shown in A Node.js code snippet demonstrating how to delete a specific file from an OpenAI vector store using the client library. |
examples/retrieval-openai-api-openai-api-vectorstores-files-list-python.text | A Python code snippet demonstrating how to list files within a specific OpenAI vector store using the client library. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to list files within a specific OpenAI vector store using the client library. |
examples/retrieval-openai-api-openai-api-vectorstores-files-list-nodejs.text | A Node.js code example demonstrating how to list files within a specific OpenAI vector store. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to list files within a specific OpenAI vector store. |
examples/retrieval-openai-api-openai-api-vectorstores-filebatches-createandpoll-p.text | A Python code example demonstrating how to create and poll a file batch within an OpenAI vector store. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to create and poll a file batch within an OpenAI vector store. |
examples/retrieval-openai-api-openai-api-vectorstores-filebatches-createandpoll-j.text | A JavaScript code snippet demonstrating how to create and poll a file batch within an OpenAI vector store. | Exact payloads, commands, or snippets shown in A JavaScript code snippet demonstrating how to create and poll a file batch within an OpenAI vector store. |
examples/retrieval-openai-api-openai-api-vectorstores-filebatches-retrieve-python.text | A Python code snippet demonstrating how to retrieve the status of a file batch within an OpenAI vector store. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to retrieve the status of a file batch within an OpenAI vector store. |
examples/retrieval-openai-api-openai-api-vectorstores-filebatches-retrieve-nodejs.text | A Node.js code example demonstrating how to retrieve the status of a file batch within a vector store using the OpenAI API. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to retrieve the status of a file batch within a vector store using the OpenA... |
examples/retrieval-openai-api-openai-api-vectorstores-filebatches-cancel-python.text | A Python code snippet demonstrating how to cancel a file batch operation within an OpenAI vector store. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to cancel a file batch operation within an OpenAI vector store. |
examples/retrieval-openai-api-openai-api-vectorstores-filebatches-cancel-nodejs.text | A JavaScript code snippet demonstrating how to cancel a file batch operation within an OpenAI vector store. | Exact payloads, commands, or snippets shown in A JavaScript code snippet demonstrating how to cancel a file batch operation within an OpenAI vector store. |
examples/retrieval-openai-api-openai-api-vectorstores-filebatches-list-python.text | A Python code snippet demonstrating how to list file batches within a specific OpenAI vector store. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to list file batches within a specific OpenAI vector store. |
examples/retrieval-openai-api-openai-api-vectorstores-filebatches-list-nodejs.text | A Node.js code example demonstrating how to list file batches within a specific OpenAI vector store. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to list file batches within a specific OpenAI vector store. |
examples/retrieval-openai-api-openai-api-vectorstores-files-create-python.text | A Python code snippet demonstrating how to create a file within a vector store using the OpenAI API client. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to create a file within a vector store using the OpenAI API client. |
examples/retrieval-openai-api-openai-api-vectorstores-files-create-nodejs.text | A Node.js code example demonstrating how to create a vector store file with specific attributes using the OpenAI API client. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to create a vector store file with specific attributes using the OpenAI API... |
examples/retrieval-openai-api-openai-api-vectorstore-update-python-3.text | A Python code snippet demonstrating how to update a vector store's expiration settings using the OpenAI API client. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to update a vector store's expiration settings using the OpenAI API client. |
examples/retrieval-openai-api-openai-api-vectorstore-update-nodejs-3.text | A JavaScript code snippet demonstrating how to update a vector store's expiration settings using the OpenAI client. | Exact payloads, commands, or snippets shown in A JavaScript code snippet demonstrating how to update a vector store's expiration settings using the OpenAI client. |
examples/retrieval-openai-api-openai-api-vectorstore-search-python-2.text | A Python code example demonstrating how to use the OpenAI client to search a vector store with a user query. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the OpenAI client to search a vector store with a user query. |
examples/retrieval-openai-api-openai-api-vectorstores-search-nodejs-2.text | A Node.js code example demonstrating how to use the OpenAI client to search a vector store with a user query. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use the OpenAI client to search a vector store with a user query. |
examples/retrieval-openai-api-openai-api-retrieval-python-format-results.text | A Python code snippet demonstrating how to iterate through retrieval results and format content for a chat completion request. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to iterate through retrieval results and format content for a chat completion... |
examples/retrieval-openai-api-openai-api-retrieval-results-formatting-javascript.text | A JavaScript code snippet demonstrating how to map and join text content from OpenAI API retrieval results for use in chat completions. | Exact payloads, commands, or snippets shown in A JavaScript code snippet demonstrating how to map and join text content from OpenAI API retrieval results for use in... |
examples/retrieval-openai-api-openai-api-retrieval.text | A text sample demonstrating the content structure used for the OpenAI Retrieval API. | Exact payloads, commands, or snippets shown in A text sample demonstrating the content structure used for the OpenAI Retrieval API. |
examples/retrieval-openai-api-openai-api-retrieval-python-format-results-function.text | A Python function named formatresults that iterates through API retrieval data to concatenate text parts into a single formatted string. | Exact payloads, commands, or snippets shown in A Python function named formatresults that iterates through API retrieval data to concatenate text parts into a singl... |
examples/retrieval-openai-api-openai-api-retrieval-format-results-javascript.text | A JavaScript function that iterates through API retrieval results to concatenate and format text content into a single string. | Exact payloads, commands, or snippets shown in A JavaScript function that iterates through API retrieval results to concatenate and format text content into a singl... |
What This Skill Covers
- The Retrieval API allows you to perform semantic search over your data, which is a technique that surfaces semantically similar results — even when they matc...
- Main sections:
Quickstart,Semantic search,Performing semantic search,Query rewriting,Attribute filtering.
Workflow
- Open the most relevant file under
docs/for the exact documented workflow and wording. - Open
schemas/files for exact structured contracts. - Open
examples/files for concrete requests, commands, snippets, and manifests. - Do not add behavior or configuration that is not present in the attached source files.
Canonical source: https://developers.openai.com/api/docs/guides/retrieval
