Custom AI Assistants in Practice: The Code and Commands That Really Matter

Personalized AI Assistants: The Essentials in One Article — Real Code, Diagrams, and Concrete Steps, Excerpts from a 44-Lesson Course.

Custom AI Assistants in Practice: The Code and Commands That Really Matter

No endless theory here: open the terminal and practice. Here's the essentials of Custom AI Assistants, extracted directly from a complete 44-lesson course — with real code you can copy-paste right now.

tl;dr
  • Introduction and Getting Started
  • Designing an Effective Assistant
  • Creating Custom GPTs
  • Claude Projects and Gemini Gems
  • Actions and External Tools
~$ cat ./parcours.md # Personalized AI Assistants — 10 chapters
01
Introduction and Getting Started
→ Course presentation and 2026 overview→ Compare GPTs / Projects / Gems / Copilot Studio+ 1 more lessons
02
Designing an Effective Assistant
→ Define the problem and target persona→ Scope: what the assistant does and does NOT do+ 2 more lessons
03
Create Personalized GPTs
→ GPT Builder: conversational interface vs configure→ Instructions, starters and professional logo+ 2 more lessons
04
Claude Projects and Gemini Gems
→ Claude Projects: custom instructions and knowledge→ Leverage Claude's large context window+ 2 more lessons
05
Actions and External Tools
→ GPT Actions: OpenAPI 3.1 schema→ Authentication: API key, OAuth+ 2 more lessons
06
Microsoft Copilot Studio
→ Copilot Studio: interface and concepts→ Topics and conversational flows+ 2 more lessons
07
OpenAI Assistants API
→ Assistants API: architecture and concepts→ Threads, messages and runs+ 2 more lessons
08
Security and Privacy
→ Defensive prompts and anti-jailbreak→ Protect your confidential instructions+ 1 more lessons
🏁
Final project (+ 2 chapters along the way)
→ You leave with a concrete and demonstrable project

Threads, messages and runs

NOTEObjective — Concretely manipulate Threads, Messages and Runs in Python: create a conversation, add a message, launch a Run, retrieve the response. Understand polling and streaming.

Learning objectives

TIPAt the end of this module
  • Create and manage a conversation Thread
  • Add user messages to a Thread
  • Launch a Run and manage its lifecycle
  • Choose between polling and streaming
  • Retrieve and display the assistant's response

Threads: what are they concretely?

A Thread is a persistent container that stores the history of a conversation between a user and an assistant. OpenAI persists it on its servers. You only manage the ID.

Best practice: one Thread per user session. For example, in your app, you create a Thread when the user starts conversing. You store the thread_id in your database.

StatusMeaning
queuedQueued, will start
in_progressThe assistant is generating the response
requires_actionFunction call: your code must respond
completedCompleted successfully
failedFailed, see last_error
cancelledManually cancelled
expiredTimeout (10 minutes)

Polling: wait for the Run to finish

The classic pattern consists of regularly checking the status until completion:

Complete example: simple conversation

A global Assistant

Create the Assistant once and store its ID in config.

One Thread per session

Create a Thread when the user connects, store the ID in the database.

Retrieve the Thread

With each new message, reuse the stored ID to preserve history.

Limits and quotas

AspectLimit
Run timeout10 minutes
Messages per ThreadNo strict limit, but monitor
Threads per accountNo strict limit
Concurrent RunsDepends on tier (10-1000 simultaneous)
Thread Storage30 days by default, automatic purge after

File search and code interpreter

NOTEObjective — Enable and configure the two most powerful native tools of the Assistants API: File Search for native RAG, Code Interpreter to execute Python in a sandbox.

Learning objectives

TIPAt the end of this module
  • Create a Vector Store and upload files to it
  • Attach a Vector Store to an Assistant for RAG
  • Enable Code Interpreter and test Python computation
  • Retrieve files generated by Code Interpreter
  • Combine both tools in the same Assistant

File Search: OpenAI's native RAG

File Search is the native RAG tool of the Assistants API. You give it files, it indexes them automatically (chunking, embedding, vector store) and allows the Assistant to search for relevant passages.

Difference with a custom RAG: with File Search, you neither choose a chunker, nor an embedding model, nor manage a vector DB. OpenAI does everything.

Vector Stores

A Vector Store is a container of indexed files, reusable across multiple Assistants. You create it once, add your documents, then attach it to the Assistants that need it.

TIPResult: responses are enriched by your documentation, with automatic citations in the message annotations.

Retrieving citations

Enabling Code Interpreter

Uploading a file for Code Interpreter

Function calling and custom tools

NOTEObjective — Allow an Assistant to call your own Python functions (function calling) to execute business logic, read internal databases or orchestrate complex actions beyond the native tools.

Learning objectives

TIPAt the end of this module
  • Define a custom function in JSON Schema format
  • Attach it to an Assistant as a tool
  • Handle the requires_action status and submit a response
  • Define multiple functions and let the Assistant choose
  • Build a mini-agent that combines multiple tools

Why function calling?

File Search and Code Interpreter are powerful but limited: they only access files and local Python. For EVERYTHING else (your internal DB, your custom APIs, specific business actions), you need function calling.

Principle: you describe your Python functions to the model. When it wants to call them, it returns the function name and arguments. You execute the function on your side and submit the result.

Defining a function in JSON Schema format

You describe each function with a name, a description, and a parameter schema:

Handling the requires_action status

When the Assistant decides to call your function, the Run moves to the requires_action status. You must:

Parallelization of tool_calls

If the Assistant requests multiple functions at the same time (for example "give me the weather in Paris AND Lyon"), you can execute them in parallel to gain performance:

Mini-agent: combining native tools and functions

The pinnacle: an Assistant that combines file_search, code_interpreter AND your custom functions. Becomes a true agent.

go-further

This article covers the most useful excerpts — the complete Custom AI Assistants course (11 chapters, 44 lessons, corrected exercises and final project) takes you all the way.

./access-the-complete-course free course: Prompt Engineering

FAQ

How long does it take to learn Custom AI Assistants?
With structured progression (11 chapters, 44 short and practical lessons), you reach an operational level in a few weeks at 30 to 60 minutes per day. The key is to practice each concept immediately.
Are there any prerequisites?
Basic computer knowledge is sufficient. If you know how to use a terminal and read simple code, you're ready.
Where to start concretely?
Reproduce the commands from this article, then follow the complete Custom AI Assistants course: it sequences the 44 lessons in order, with exercises and a final project.

📬 Want to receive this type of guide every week? Subscribe for free — real code, zero fluff.