跳到正文
原文
Google AI:DEV 作者专属(RSS)· Fadhlullah Mustapha·· 3 小时前AI 评分38

我打造了一个跨设备记住你的聊天机器人 Pickup——6 点经验总结

I Built a Chatbot That Remembers You Across Devices — 6 Things I Learned

AI 导读

开发者基于 Walrus 主网构建了跨浏览器与设备记忆用户的聊天机器人 Pickup,并总结出 6 点工程经验。记忆检索设置了 8 秒超时,超时后正常回答并告知用户未使用最新记忆;一次 Walrus 主网写入实测耗时 36 秒,因此改为先回复再后台保存记忆。此外还涉及记忆过滤、写入队列、写入后索引未及时可读以及所用 SDK 暂无删除方法等限制。

正文

I built Pickup, a chatbot that remembers users across browsers and devices using Walrus mainnet.

I thought the hard part would be storing and retrieving memories.

It wasn't.

The real challenge was making decentralized storage work smoothly behind a chatbot. These were the six things I learned.

  1. Memory can't be allowed to freeze the chatbot

If memory retrieval is slow, the whole chat shouldn't have to wait.

I added an 8-second timeout. If memory doesn't come back in time, the chatbot answers normally and tells the user that it answered without the latest memory.

The chatbot should still work when memory doesn't.

  1. Don't make users wait for writes

One Walrus mainnet write took 36 seconds in my testing.

Waiting 36 seconds after every message obviously isn't acceptable.

So I changed the flow:

Reply first → save memory afterward.

The user gets the response immediately while the memory is saved in the background.

  1. Don't remember everything

Saving every message creates a lot of useless memory.

I added a simple filter that skips short conversations and messages that don't contain useful information about the user.

For example:

"Why does it 429?" → skip

"I'm running v0.1.8 and getting 429 errors." → save

The goal isn't to remember everything.

It's to remember the right things.

  1. A successful write may not be immediately readable

I ran into an interesting consistency issue.

A memory could be successfully saved, but the next recall wouldn't find it because the index hadn't caught up yet.

So I temporarily keep recently saved memories on the client and include them in recall results until the server catches up.

In other words:

Written ≠ immediately readable.

That's something I had to design around.

  1. Queue your writes

Sending several writes at once caused rate-limit failures.

The fix was simple:

One namespace, one write at a time.

Instead of firing every write immediately, I queue them.

  1. Show the user what the chatbot remembered

Pickup shows the memories used for each response and how old they are.

This turned memory from a black box into something I could actually inspect.

When the chatbot gives an unexpected answer, I can see whether it used the wrong memory, an old memory, or no memory at all.

One limitation

The SDK I'm using currently doesn't provide a delete method.

So I didn't add a fake delete button.

Instead, the UI warns users not to store secrets or sensitive information in persistent memory.

I'd rather be honest about the limitation than pretend deletion is guaranteed.

The main lesson

Building persistent AI memory taught me that storage is only part of the problem.

Once storage sits behind a real-time chatbot, you also have to think about:

Latency. Consistency. Rate limits. Memory quality. Observability.

That's where most of the interesting engineering happened.

Pickup was built for Walrus Sessions 8.

Code:
https://github.com/JUICEWRLD998/pickup

来源:Google AI:DEV 作者专属(RSS) · dev.to