Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Agent Memory — Shared Memory for AI Agents

A lightweight, zero-auth REST API that lets AI agents share memory across machines. SQLite-persistent — memories survive server restarts.

One agent remembers. All agents benefit. No cloud, no tokens, no complexity.

How it works

Agent A (laptop)  ──POST /memory/agent-a──▶  ┌──────────────────┐
Agent B (phone)   ──GET  /memory/agent-a──▶  │  Memory Server   │
Agent C (cloud)   ──GET  /memory/agent-b──▶  │  (any machine)   │
                                              └──────────────────┘

Each agent has its own namespace (/memory/<agent_id>). Keys are simple strings. Values are text.

API

Method Endpoint Description
POST /memory/<agent_id> Store {"key":"...", "value":"..."}
GET /memory/<agent_id>/<key> Retrieve a single value
GET /memory/<agent_id> List all memories for an agent
DELETE /memory/<agent_id>/<key> Delete a memory

No authentication. No API keys. Designed for private networks.

Quick Start

1. Run the server

pip install flask
python server.py
# → Listening on http://0.0.0.0:9736

Configuration :

  • AGENT_MEMORY_DB : chemin du fichier SQLite (défaut : ./memory.db)
  • PORT : port d'écoute (défaut : 9736)

2. Use from any agent

# Store
curl -X POST http://<server-ip>:9736/memory/my-agent \
  -H "Content-Type: application/json" \
  -d '{"key":"greeting","value":"hello from laptop"}'

# Retrieve
curl http://<server-ip>:9736/memory/my-agent/greeting
# → {"key":"greeting","value":"hello from laptop"}

# List all
curl http://<server-ip>:9736/memory/my-agent

3. Python client (optional)

from client import AgentMemory

mem = AgentMemory("http://<server-ip>:9736", "my-agent")
mem.set("favorite_color", "blue")
print(mem.get("favorite_color"))  # blue
print(mem.list())                  # all keys
mem.delete("favorite_color")

Use cases

  • Cross-session memory — agents remember facts across restarts
  • Multi-agent coordination — agents share discovered knowledge
  • Configuration hub — store API keys, preferences, environment details
  • Phone ↔ Laptop sync — your phone agent knows what your desktop agent learned

Why not a database?

  • Zero setup — no PostgreSQL, no Redis, no credentials
  • Human-readable — curl it, debug it, inspect it
  • Single file — server.py is ~80 lines
  • Network-native — works over LAN, VPN, or Tailscale

Security

This server has no authentication. Run it on a trusted network only (LAN, VPN, or overlay network). Do not expose it to the public internet.

License

MIT

About

Lightweight shared memory server for AI agents — simple REST API, no auth, runs anywhere

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages