Show HN:一款用于智能体记忆的轻量级无状态数据库
Show HN: A lightweight, stateless database for agent memory

原始链接: https://polign.com/blog-edge-agent-memory

Anup Talwalkar 介绍了 **polign_db**,这是一种旨在解决智能体(Agent)记忆中两个核心挑战的方案:可靠性与硬件限制。 1. **确定性记忆:** 当前的大语言模型在管理自身历史记录时往往难以保证准确性,常无法协调矛盾的信息或更新。Polign_db 将此任务转移至一个**类型化数据库**,通过基于模式(schema)的规则进行事实替换与验证。数据库无需大语言模型去解读原始文本,而是直接执行逻辑(如更新事实或比较数值),从而确保了高精度。 2. **资源效率:** 传统的向量数据库需要昂贵的常驻基础设施。Polign_db 被设计为一种“冷启动优先”的数据库,运行在对象存储(如 S3)上,且仅需极少的常驻内存。它无需庞大的服务器集群即可实现高性能语义搜索,非常适合低功耗边缘设备和小型 ARM 设备。 通过将结构化数据管理与轻量级存储相结合,polign_db 使智能体能够拥有独立于大语言模型随机性的、可靠且持久的记忆。该系统旨在为未来智能体完全在本地设备上运行、而非依赖昂贵的基于订阅的云服务提供支持。

Anuup Talwalkar 推出了 **Polign**,这是一款专为人工智能代理记忆设计的轻量级无状态数据库。该系统结合了向量搜索与 BM25,支持类型化事实和结构化查询。 Polign 的一个关键特性在于其架构:它使用 S3 或 GCS 存储桶作为主要存储,支持快速重启节点,并具有极低的运维开销。该系统专为动态工作负载而设计,数据在被访问至热缓存前保持“冷”状态,这使得多个读取器能够高效地访问大型索引。 在讨论帖中,有用户指出 Polign 目前为闭源,并建议使用基于 Litestream 的 SQLite 作为替代方案。Talwalkar 承认了其闭源性质,并说明 Polign 的构建是为了应对特定挑战——例如多读取器访问和减少对本地存储的依赖——这些方面与标准的基于 SQLite 的工作流有所不同。 感兴趣的用户可访问 [polign.com](https://polign.com) 查看演示和文档。
相关文章

原文

August 24, 2026 · Anup Talwalkar · Polign

I've been thinking about agent memory for quite some time. There are really two things that bother me. The first is how we represent memory in the agent space. The second is where that memory should live when the agent is running on a hardware constraints. Somehow my work converged both of the concerns into a single answer.

1. The memory needs to be deterministic when dealing with LLMs

What I've observed in my own agent use is that there are certain behaviors and patterns that LLMs can't follow and sometimes miss or forget. I would correct a fact and the agent would quote the old version a week later. I would change a preference and recall would return both versions, and the model had to guess which one I meant. I realized something. Right now we make the LLM sort this out by rereading old text, which costs tokens when it works and accuracy when it tries to rely on semantic retrieval. A schema with types and supersession rules answers the same question instantly.

When a model manages its own memory, it has to decide whether the recalled text is new or a correction, whether the instructions contradict something already stored. These are mostly schema decisions, and shouldn't be left to the model to figure out.

A typed memory store moves those decisions out of the model and into the schema. The model extracts a fact; the database determines what that fact means.

2. Serverless/cold-first database that must be accessible on a small hardware

The edge angle comes from something I keep returning to. During my time at Google Cloud Storage, I saw how much tooling and infrastructure was needed to support simple semantic storage use cases. The operational cost became obvious once we realized how the index and semantic storage would scale with the growing corpus. For example, hot vector index (along with availability guarantees via replication) in RAM or even SSDs is expensive, and isn't really needed for users with infrequent and cold queries. Every memory design I had seen assumed a search cluster or a managed API on the other side of a network link. Meanwhile embedding models were already running fine on CPU cycles and small models are getting better every few months.

I ended up building polign_db as a typed database on top of the hybrid vector + BM25 engine and living in an object store. The polign_db server holds nothing durable, so processes and machines can die and restart and the memory stays intact. Initially while working on polign_db, I wanted it to serve search from object storage with as little resident state as possible, and with query costs that do not grow with the corpus size. Those choices were about cloud bills, but they also happened to be what small devices need.

As a side note, the Wikipedia search demonstrates polign_db. The demo serves 12.5 million passages from S3 while the server idles at about 37 MiB RSS, and the whole demo, embedder and web app included, fits on a 2 GB ARM machine. Most of that memory goes to embedding generation and query concurrency, not the database.

Running the agent memory demo

The footprint for this demo is small. You need three things to run it:

  • polign-server: curl -fsSL https://get.polign.com | sh
  • Go, since the demo runs with go run
  • an Anthropic or OpenAI API key, exported as ANTHROPIC_API_KEY or OPENAI_API_KEY

Then point the demo at a local directory:

./run-demo.sh fs:./demo-bucket

Claude models are the default. To use an OpenAI model instead, pass the model id and the provider is inferred from it:

./run-demo.sh fs:./demo-bucket -model gpt-5

Tell it something:

you> I use Vim as my editor.
  → remember_preference({"subject":"user","predicate":"prefers_editor","value":"vim"})
  ← {"stored":{"id":"m-...","value":"vim","status":"active",...}}

Numbers work as numbers:

you> Is my step goal above 8000?
  → recall({"subject":"user","predicate":"daily_step_goal","value_min":8000})
  ← {"count":1,"records":[{"value":9000,...}]}

That comparison is running in the database. The model never had to look at a paragraph and decide whether 9000 is more than 8000.

Semantic recall sits next to the filters. The demo embeds queries with a small local model and searches the same records. The indexing, validation and storage is handled by polign_db.

The local agent stack

The stack I expect to see more of is a pile of small, boring parts:


┌─────────────────────────────┐
│         Local LLM           │
│         conversation        │
└──────────────┬──────────────┘
               │
┌──────────────▼──────────────┐
│        Typed memory         │
│                             │
│ validation                  │
│ supersession                │
│ structured filtering        │
│ semantic recall             │
└──────────────┬──────────────┘
               │
┌──────────────▼──────────────┐
│      Durable local store    │
│        /var/lib/agent       │
└─────────────────────────────┘

The embedder and the database can already run on small hardware today. As local models improve, the whole agent will be able to move onto the device, and at that point memory does not need to be an afterthought or a service subscription. It is a typed interface over storage you own.

I kept the agent memory demo open source, but the underlying polign_db is closed source. The demo and the downloads are not gated and freely available to download and install. The getting started guide covers the installation steps.

Leave a note and your email on the signup page and I will follow up as soon as I can (usually within a few hours/a day).

联系我们 contact @ memedata.com