@usecarry/vercel-ai drops Carry’s gate into any Vercel AI SDK model. Memory is recalled and gated before generation — the model only ever sees authorized memory — and every call emits an Answer Receipt.
One line
generateText, streamText, generateObject — anything that takes a model.
Why
A raw vector-DB memory layer hands the model everything it retrieves. Carry enforces an agent × namespace policy at retrieval, so a revoked namespace is never injected into the prompt — and every generation carries a receipt proving exactly what memory reached the model.API
withCarryMemory(model, opts)
Wraps a model with the Carry middleware. Returns the same model type.
carryMiddleware(opts)
The raw
LanguageModelMiddleware, if you compose your own wrapLanguageModel.createMemoryStore({ memories, policy })
An in-memory Carry vault (default-allow;
policy[agent][ns] = false revokes).CarryStore
Implement
recall(agent, query) to back it with your own store — Walrus, a DB, the CLI vault.{ store, agent?, onReceipt? }. onReceipt(receipt) fires on every call with { agent, query, used, blockedNamespaces, createdAt }.