Step 1: create the agent
202. You are now the owner.
400 invalid_request:agent_configis missingroleorobjective. Add them.409 agent_quota_exceeded: you already own 20 agents. Delete one you no longer use.
Step 2: wait until the agent is ready
200 with "status": "ready". This usually takes a few seconds. Call again every second until you see it.
If it is not ready:
"status": "initializing"for more than a minute: keep calling. The agent is still being prepared. After 10 minutes, the status becomesfailed."status": "failed": delete the agent and create a new one.404 agent_not_found: the id is wrong, or the agent belongs to another organization.
Step 3: create a thread
201.
409 agent_not_ready: you did not wait for step 2. Poll the agent until its status isready.429 rate_limit_exceeded: more than 5 threads in 10 seconds. WaitRetry-Afterseconds.
Step 4: teach the agent
202. Nothing is learned yet.
400 invalid_request: acontentlist is empty, or a block is not{"type": "text", ...}.404 thread_not_found: the thread id is wrong, or the thread belongs to another account.
Step 5: wait until the facts are learned
200 with "status": "committed".
queuedorprocessing: call again in one second.failed: readerror. Correct the observation and send it again.interrupted: a Priors restart paused it. It resumes by itself. Keep polling.
Step 6: ask a question
200. The answer is in response_context.
used_memory_ids is not empty. That means the answer came from a memory, not from a guess. When it is empty, the agent had no related memory.
If it fails:
429 rate_limit_exceeded: more than 20 answers in one minute, or 2 answers already running. WaitRetry-Afterseconds.503 answer_model_unavailable: wait, then send the request again.
What this walkthrough showed
- Creating an agent and learning both finish after the response. Poll, then continue.
- The question in step 6 is now a memory too.
- The thread is yours. The memory belongs to the agent. A second thread answers the same question in the same way.