Pi Coding Agent for Beginners / Chapter 1 — Getting to Know Pi (lessons 1–4) / Lesson 1
What Pi Is
Time needed: about 6 min (estimate)
Reading settings
These settings are remembered on this device only.
You can try the opening of this lesson without an account.
Pi is an AI agent that runs in your terminal
Pi is an AI agent you use from the terminal. Start pi in the folder you want to work in and tell it the goal: it reads files, runs commands, and edits files as it works through multi-step tasks. It isn't only for code; it also works on notes, writing, and data files. Pi is made by Earendil and is open source under the MIT license. This course was checked against Pi 1.6.1.
One run is a loop of turns
Your message is sent to the model together with the system prompt, the conversation so far, and the list of available tools. The model's reply contains text and tool calls; Pi runs each call and records the result. That is one turn. If the results need another model request, Pi starts the next turn, and the run ends once the model stops calling tools. The code below imitates this flow with a scripted model.
Tab indents. To leave the editor, press Esc, then Tab.
Create a free account to keep reading
With an account you can read the rest of this lesson, take the quiz, and read every free lesson in this course. Lessons you answer correctly are recorded as complete.
Report a problem with this lesson
Log in to send a report.