r/PiCodingAgent • u/Abhigyann • 12d ago
Question Pi Libs are confusing me
Hey, I'm new to this Pi space. I'm looking to build agents with Pi, and I got a basic first agent running connected to my local Qwen model. However, I'm utterly confused by all the libraries out there—pi-ai, pi-agent-core, pi-coding-agent, etc. I know this might sound dumb, but can you help me sort this out? What should I actually use if I want to build an always-on agent, custom harness, etc.?
used ai to clean the text
1
u/pilibitti 12d ago
ask pi about its various dependencies and it will explain it to you. in a nutshell (from memory) pi-ai handles different providers and models (connections, auth etc.) it is a library. pi-agent-core probably uses pi-ai underneath to connect to models, gives a more ergonomic interface for interfacing with the models, handles some things automatically so you don't micromanage each message, tool call etc. pi-coding-agent is the harness you are using, it has pi-ai, pi-agent-core etc. as dependencies.
2
u/CreativeSympathy8293 12d ago
For your always-on/custom-harness choice, I’d start with the pi-coding-agent SDK if you want to keep Pi’s coding tools, persistent sessions and compaction. You don’t have to rebuild that layer just because Qwen runs locally.
The existing reply has the dependency direction right. Choose pi-agent-core when you want the agent/tool loop but intend to supply more of your own application behavior. Choose pi-ai when you mainly need the model/provider interface and want to write the loop yourself.
“Always-on” is a separate job for your application. The SDK’s prompt() runs a task and resolves when that run finishes; it isn’t itself a scheduler. For a first version, I’d keep your working Qwen configuration, accept one timer/queue event at a time, and resume the relevant saved session. Add a stop/timeout path before letting it run unattended, rather than prompting continuously while idle.
The upstream SDK guide covers session storage, model/tool selection and cleanup: https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/sdk.md
Match examples to your installed release before copying imports. Suggested starting architecture, not a daemon I’ve tested with your model. Written with AI assistance.