From agno-agentos-api
Interact with AgentOS Memory API endpoints. For standard operations (listing, creating, updating, deleting memories, searching, topics), use the provided CLI script first. Only write custom Python when the script cannot handle the use case (e.g., advanced filtering, stats, chaining multiple calls, integration tests). Trigger when: managing user memories, writing scripts to manage user preferences, creating memory tests, or asking things like "what memories does this user have?" or "add a preference for dark mode."
How this skill is triggered — by the user, by Claude, or both
Slash command
/agno-agentos-api:agentos-api-memoryThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use `agno.client.AgentOSClient` to create, list, update, and delete user memories on a remote AgentOS instance. Memories persist user preferences and facts across sessions.
Use agno.client.AgentOSClient to create, list, update, and delete user memories on a remote AgentOS instance. Memories persist user preferences and facts across sessions.
Start an AgentOS server with memory enabled:
from agno.agent import Agent
from agno.models.anthropic import Claude
from agno.db.sqlite import SqliteDb
from agno.memory import MemoryManager
from agno.os import AgentOS
db = SqliteDb(db_file="tmp/app.db")
agent = Agent(
name="Assistant",
model=Claude(id="claude-sonnet-4-5"),
db=db,
memory_manager=MemoryManager(model=Claude(id="claude-sonnet-4-5"), db=db),
update_memory_on_run=True,
)
agent_os = AgentOS(agents=[agent])
agent_os.serve()
Always try the provided script first. It covers listing, searching, creating, updating, and deleting memories — plus listing topics — all from the command line with no custom code needed.
The script is at: scripts/manage_memories.py
uv run scripts/manage_memories.py --user-id [email protected]
uv run scripts/manage_memories.py --user-id alice --search "dark mode"
uv run scripts/manage_memories.py --user-id alice \
--create "User prefers dark mode" --topics preferences,ui
uv run scripts/manage_memories.py --memory-id abc-123 --user-id alice
uv run scripts/manage_memories.py --memory-id abc-123 --user-id alice \
--update "User strongly prefers dark mode" --topics preferences,ui,accessibility
uv run scripts/manage_memories.py --memory-id abc-123 --user-id alice --delete
uv run scripts/manage_memories.py --topics-list
uv run scripts/manage_memories.py --base-url http://my-server:8000 --user-id alice
uv run scripts/manage_memories.py --help
Only write ad-hoc Python when the CLI script cannot handle your use case:
agent_id, team_id, topic filters, pagination, sorting)get_user_memory_stats)| Method | Path | Description |
|---|---|---|
| GET | /memories | List memories (paginated, filterable) |
| GET | /memories/{memory_id} | Get memory by ID |
| GET | /memories/topics | Get all memory topics |
| GET | /memories/stats | Get user memory stats |
| POST | /memories | Create a memory |
| PATCH | /memories/{memory_id} | Update a memory |
| DELETE | /memories/{memory_id} | Delete a memory |
The list endpoint supports filtering beyond what the CLI provides:
import asyncio
from agno.client import AgentOSClient
async def main():
client = AgentOSClient(base_url="http://localhost:7777")
memories = await client.list_memories(
user_id="user-123",
agent_id="my-agent",
topics="preferences,ui",
limit=50,
page=2,
sort_by="created_at",
sort_order="asc",
)
print(f"Found {len(memories.data)} memories")
for mem in memories.data:
print(f" {mem.memory_id}: {mem.memory}")
asyncio.run(main())
Retrieve aggregated memory statistics:
stats = await client.get_user_memory_stats()
print(f"Stats: {len(stats.data)} entries")
Chain multiple calls when you need create-then-verify flows:
import asyncio
from agno.client import AgentOSClient
async def main():
client = AgentOSClient(base_url="http://localhost:7777")
user_id = "demo-user"
# Create
memory = await client.create_memory(
memory="Favorite color is blue",
user_id=user_id,
topics=["preferences"],
)
print(f"Created: {memory.memory_id}")
# List
memories = await client.list_memories(user_id=user_id)
print(f"Total memories: {len(memories.data)}")
# Update
updated = await client.update_memory(
memory_id=memory.memory_id,
memory="Favorite color is dark blue",
user_id=user_id,
topics=["preferences", "colors"],
)
print(f"Updated: {updated.memory}")
# Delete
await client.delete_memory(memory.memory_id, user_id=user_id)
print("Deleted")
asyncio.run(main())
user_id — memories are scoped to usersupdate_memory_on_run=True on agents — required for automatic memory creationFor advanced memory API patterns, read references/api-patterns.md.
npx claudepluginhub ajshedivy/agno-cookbook --plugin agno-agentos-apiCross-host durable memory for AI agents using the ling-mem CLI. Maintains a three-tier model of who the user is across sessions and hosts (Claude Code, Codex, OpenClaw).
Best practices for memory architecture design including user vs agent vs session memory patterns, vector vs graph memory tradeoffs, retention strategies, and performance optimization. Use when designing memory systems, architecting AI memory layers, choosing memory types, planning retention strategies, or when user mentions memory architecture, user memory, agent memory, session memory, memory patterns, vector storage, graph memory, or Mem0 architecture.
Invoked via /memsy slash command; classifies intent (search, store, switch profile, list, doctor, setup) and runs the matching Memsy workflow for context memory.