<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Waslo Engineering]]></title><description><![CDATA[Waslo Engineering]]></description><link>https://waslo.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6ad5ea903e0a69f7132eea53/7f970787-2bf1-41f9-b341-11038aec2613.png</url><title>Waslo Engineering</title><link>https://waslo.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Sun, 25 Oct 2026 21:05:38 GMT</lastBuildDate><atom:link href="https://waslo.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Add an AI agent that remembers your users, with one REST call]]></title><description><![CDATA[Originally published on DEV. Most "add AI to your support" tutorials stop at a chat completion. The model answers, and then you discover the real work…]]></description><link>https://waslo.hashnode.dev/add-an-ai-agent-that-remembers-your-users-with-one-rest-call</link><guid isPermaLink="true">https://waslo.hashnode.dev/add-an-ai-agent-that-remembers-your-users-with-one-rest-call</guid><category><![CDATA[AI]]></category><category><![CDATA[ai agents]]></category><category><![CDATA[api]]></category><dc:creator><![CDATA[Waslo]]></dc:creator><pubDate>Mon, 19 Oct 2026 10:18:24 GMT</pubDate><content:encoded><![CDATA[<p><em>Originally published on <a href="https://dev.to/waslo/add-an-ai-agent-that-remembers-your-users-with-one-rest-call-3mdc">DEV</a>.</em></p>
<p>Most "add AI to your support" tutorials stop at a chat completion. The model answers, and then you discover the real work: remembering who the user is between messages, answering from <em>your</em> documents instead of the internet, knowing when a message is a hot lead, booking a slot without double-booking, and not charging twice when your client retries a request.</p>
<p>We built all of that for our own product, an AI agent that answers customers on WhatsApp, Instagram, Messenger, Telegram, email and website chat. The same engine is available as a REST API, so you can run it inside your own app without any of those channels. This post shows what one call looks like and what comes back.</p>
<h2>The one call</h2>
<pre><code class="language-bash">curl https://api.waslo.io/v1/agent/reply \
  -H "Authorization: Bearer wsk_live_..." \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 8f1c2e40-msg-001" \
  -d '{
    "message": "Do you have a morning slot on Thursday?",
    "userId": "customer_8842",
    "tools": ["calendar"]
  }'
</code></pre>
<p>Three fields matter:</p>
<ul>
<li><strong><code>message</code></strong>: what your user typed.</li>
<li><strong><code>userId</code></strong>: any stable id from your system. It is how the agent remembers a person. Send the same id tomorrow and the conversation continues where it left off; send a new id and it starts fresh. There is no session object to create or store.</li>
<li><strong><code>tools</code></strong>: what the agent may do on this turn. <code>calendar</code> lets it check real availability and book; <code>catalog</code> lets it look up and send products. Leave it out and the agent only talks.</li>
</ul>
<h2>What comes back</h2>
<pre><code class="language-json">{
  "reply": "Yes, Thursday at 9:30 or 11:00 is free. Which one suits you?",
  "classification": "HOT",
  "citations": [
    { "documentName": "opening-hours.pdf", "preview": "Thursday 09:00–13:00..." }
  ],
  "usage": { "credits_charged": 3, "credits_remaining": 597 },
  "request_id": "req_..."
}
</code></pre>
<ul>
<li><strong><code>reply</code></strong> is ready to show. It already used the user's history and your knowledge base.</li>
<li><strong><code>classification</code></strong> scores the lead <code>HOT</code>, <code>WARM</code> or <code>COLD</code> on every turn (or with your own stage names, if you set them), so your app can route a hot conversation to a person straight away. If you define your own topic labels, a <code>topic</code> field comes back too.</li>
<li><strong><code>citations</code></strong> tell you which of your documents the answer came from. That is useful for debugging and for showing users where an answer came from.</li>
<li><strong><code>usage</code></strong> tells you what the call cost and what is left. No surprise invoices.</li>
</ul>
<h2>Teaching it about your business</h2>
<p>The agent answers from documents you upload. That can be price lists, FAQs, policies or product sheets:</p>
<pre><code class="language-bash">curl https://api.waslo.io/v1/kb/documents \
  -H "Authorization: Bearer wsk_live_..." \
  -F "file=@pricing-faq.pdf" \
  -F "name=Pricing FAQ"
</code></pre>
<p><code>GET /v1/kb/documents</code> lists them and <code>DELETE /v1/kb/documents/:id</code> removes one. The same workspace is visible in the Waslo dashboard, so a non-technical teammate can add documents there and your code sees them immediately.</p>
<p>If you sell products, <code>/v1/catalog</code> lets you list, create, update and delete items in the catalogue the agent sells from, including photos and PDFs it can send.</p>
<h2>Memory you can inspect and delete</h2>
<p>Every remembered fact about a user is readable and deletable:</p>
<pre><code class="language-bash"># what does the agent remember about this user?
curl https://api.waslo.io/v1/memory/customer_8842 \
  -H "Authorization: Bearer wsk_live_..."

# forget them (privacy request, test cleanup, account deletion)
curl -X DELETE https://api.waslo.io/v1/memory/customer_8842 \
  -H "Authorization: Bearer wsk_live_..."
</code></pre>
<p>Being able to delete memory with one call matters more than it sounds. It is what you need when a user asks you to forget them.</p>
<h2>Controlling behaviour</h2>
<p><code>PUT /v1/config</code> sets the agent's system prompt and behaviour persistently. You can also pass <code>systemPrompt</code> on a single request with <code>promptMode: "append"</code> or <code>"replace"</code>.</p>
<p><code>replyLanguage</code> is the setting people ask about most. <code>"auto"</code> answers each user in the language they wrote in. A code like <code>"es"</code> or <code>"ar"</code> always answers in that language.</p>
<h2>The boring parts that save you a weekend</h2>
<ul>
<li><strong>Idempotency.</strong> Send an <code>Idempotency-Key</code> header and a retried request within 24 hours returns the original response instead of generating, and billing, a second reply.</li>
<li><strong>Spend cap.</strong> Set a monthly cap and requests are refused with <code>spend_cap_reached</code> once you hit it, so a runaway loop stops at your cap instead of draining your balance.</li>
<li><strong>Scoped keys.</strong> Keys carry scopes (<code>agent</code>, <code>memory</code>, <code>kb</code>, <code>catalog</code>, <code>config</code>, <code>usage</code>) and are stored hashed. Keep them server-side; never ship one in a browser or mobile bundle.</li>
<li><strong>One error envelope.</strong> Every error has the same shape and a <code>request_id</code>. <code>402</code> means out of credits or capped, <code>403</code> means the key lacks a scope, and <code>429</code> means slow down (the header tells you for how long).</li>
<li><strong>Media in.</strong> Replies can read images, audio, video and PDFs sent by the user, and can answer with a voice note.</li>
</ul>
<h2>What it costs</h2>
<p>The API bills credits per call: 2 for a text reply, 3 when it used a tool, 5 when it read media, plus 2 for voice output. A standalone classification is 1 credit. New accounts start with 75 free credits, enough to build and test an integration before paying anything. API credit packs start at $49 for 5,000 credits.</p>
<h2>When you should not use this</h2>
<p>If all you want is an AI agent on WhatsApp or Instagram, you don't need the API. Connecting the channel in the dashboard takes a few minutes. The API is for when the conversation happens <strong>inside your product</strong>: a SaaS that wants an assistant for its own customers, an agency running agents for clients, or a team that wants lead scoring and knowledge-base retrieval without building them.</p>
<h2>Try it</h2>
<p>Create a key in the developer portal at <a href="https://waslo.io/developers">waslo.io/developers</a>. The full reference is in the <a href="https://waslo.io/docs/agent-api">Agent API docs</a>.</p>
<p>If you build something with it, I'd like to hear what broke first. That's usually the most useful feedback we get.</p>
]]></content:encoded></item></channel></rss>