# `CMDC.Memory.ETS`
[🔗](https://github.com/tupleyun/cmdc/blob/v0.5.0/lib/cmdc/memory/ets.ex#L1)

基于 ETS 的内存 Memory 实现。

适用于开发、测试或对持久化无要求的场景。进程退出后数据丢失。
ETS 表类型为 `:set`，以 entry id 为 key，entry map 为 value。

文本搜索采用关键词包含匹配（大小写不敏感），未来可升级为向量检索。

## 使用方式

    {:ok, mem} = CMDC.Memory.ETS.new(:agent_memory)
    :ok = CMDC.Memory.ETS.store(mem, "s1", %{content: "任务完成", outcome: :success})
    {:ok, results} = CMDC.Memory.ETS.search(mem, "任务", limit: 5)
    {:ok, all} = CMDC.Memory.ETS.list(mem)
    :ok = CMDC.Memory.ETS.delete(mem, "s1")

# `store`

```elixir
@type store() :: atom()
```

# `new`

```elixir
@spec new(
  atom(),
  keyword()
) :: {:ok, store()}
```

创建或获取一个 ETS Memory 表。

若同名表已存在，直接返回 `{:ok, name}`，不报错。
第二参数 `opts` 保留扩展（当前未使用）。

---

*Consult [api-reference.md](api-reference.md) for complete listing*
