Aerostack
memory

AI Chat with Memory Edge Function — Ai

AI

Persistent chat with conversation history stored in KV. Each session remembers previous messages. Supports streaming.

aerostack @aerostack verified
Updated Mar 13, 2025
GitHub

Edge function AI Chat with Memory Persistent chat with conversation history stored in KV. Each session remembers previous messages. Supports streaming.. Deployed on Cloudflare Workers — zero cold starts, globally distributed. Mount it via your Aerostack workspace to call it from any AI agent.

terminal — aerostack cli
$ npx aerostack add aerostack/ai-chat-memory
smart_toy

Use with AI Assistants

MCP

Connect Claude, Cursor, or any MCP-compatible client — then call this function by slug

① Add MCP Server

Add this once — access all Aerostack functions from your AI tool.

claude_desktop_config.json
{
  "mcpServers": {
    "aerostack": {
      "url": "https://mcp.aerostack.dev",
      "type": "http"
    }
  }
}

② Call this function

Ask your AI to use the call_function tool with this slug:

call_function
call_function({
  slug: "ai-chat-memory",
  args: {}
})

AI Chat with Memory

Stateful AI chat that remembers conversation history across requests using KV storage.

Endpoints

Method Path Description
POST /chat Send message (auto-loads history)
GET /history/:sessionId Get conversation history
DELETE /history/:sessionId Clear session history
POST /sessions Create new session
GET /health Status check

Metadata

upgrade Version 1.0.0
gavel License MIT
language Language javascript
cloud Provider cloudflare-worker

Tags

ai chat memory kv sessions
deployed_code

Build and publish your own functions

Write a TypeScript function, deploy it to the edge, and share it with thousands of developers — in minutes.

More AI Functions

Browse AI Functions →

Frequently asked questions

What does the AI Chat with Memory function do? +

AI Chat with Memory is a serverless edge function for ai automation written in cloudflare-worker. Deploy it to Cloudflare Workers via your Aerostack workspace.

How do I deploy the AI Chat with Memory function? +

Install the Aerostack CLI and run: ```bash aerostack deploy function @aerostack/ai-chat-memory ``` It will be live on Cloudflare Workers in seconds.

What runtime does AI Chat with Memory use? +

AI Chat with Memory runs on cloudflare-worker on the Cloudflare Workers edge runtime — zero cold starts, globally distributed.

Can I customise the AI Chat with Memory function? +

Yes. Fork the function from your Aerostack dashboard, modify the source, and redeploy. All changes are version-controlled.