Prompt Buddy logoPrompt Buddy

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.

Import to Prompt Buddy

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

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/retrieval-openai-api-workflow-guide.mdA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. 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