Today we publish Assistant API, our first step towards helping developers build agent-like experiences within their own apps. An assistant is a purpose-built AI that has specific instructions, uses additional knowledge, and can invoke models and tools to perform tasks. The new Assistants API provides new capabilities such as Code Interpreter and Retrieval, as well as function calls to handle many of the heavy lifting that you previously had to do yourself, and enables you to build high-quality AI applications.
This API is designed for flexibility; Use cases range from a natural language based data analytics application, a coding assistant, an AI-powered vacation planner, a voice-controlled DJ, a smart visual canvas—the list goes on. The Assistants API is built on the same capabilities that enable our new GPTs product: custom instructions and tools such as the code interpreter, fetching and calling functions.
The key change introduced by this API is persistent and infinitely long threads, which allow developers to outsource thread state management to OpenAI and bypass context window limitations. Using the Assistants API, you simply add each new message to an existing one thread
.
Assistants also have access to invoke new tools as needed, including:
- Code interpreter: writes and runs Python code in a sandboxed runtime environment, and can generate graphs and charts, and process files with different data and formatting. It allows your assistants to iteratively run code to solve challenging coding and math problems and more.
- Fetching: augments the assistant with knowledge outside of our models, such as domain ownership data, product information, or documents provided by your users. This means you don't have to compute and store embeds for your documents or implement sharing and search algorithms. The Assistants API optimizes which retrieval technique to use based on our experience building knowledge retrieval in ChatGPT.
- Calling a function: allows helpers to call functions you define and embed the function response in their messages.
As with the rest of the platform, data and files are passed to the OpenAI API it was never used to train our models and developers can delete data when they see fit.
You can try the Assistants API beta without writing code by going to Assistant playground.