AgentLoop Memory FS
Virtual filesystem for Alibaba Cloud CMS AgentLoop Memory API - designed for AI Agent interaction.
Features
- Agent-Friendly Design: Explore the filesystem with standard shell commands (
ls,cat,echo,mkdir,rm) - Self-Describing:
_help.txtfiles at every level guide usage - Semantic Search: Search memories using natural language via file paths
- POSIX Compatible: Works with any tool that uses standard file operations
Installation
Install from source
pip install .
Install from wheel
pip install build
python3 -m build
pip install dist/agentloop_memory_fs-*.whl
OS Dependencies (FUSE)
macOS
brew install macfuse
Linux (Ubuntu/Debian)
sudo apt-get install fuse libfuse-dev
Linux (CentOS/RHEL)
sudo yum install fuse fuse-devel
Configuration
Set environment variables or use a .env file:
export ALIBABA_CLOUD_ACCESS_KEY_ID="your-access-key-id"
export ALIBABA_CLOUD_ACCESS_KEY_SECRET="your-access-key-secret"
export CMS_WORKSPACE="your-workspace-name"
export CMS_ENDPOINT="cms.cn-hangzhou.aliyuncs.com" # optional
Or create a .env file in the working directory:
ALIBABA_CLOUD_ACCESS_KEY_ID=your-access-key-id
ALIBABA_CLOUD_ACCESS_KEY_SECRET=your-access-key-secret
CMS_WORKSPACE=your-workspace-name
CMS_ENDPOINT=cms.cn-hangzhou.aliyuncs.com
Usage
Mount the Filesystem
mkdir -p /tmp/memory
agentloop-memory-fs /tmp/memory
Or with options:
agentloop-memory-fs /tmp/memory --workspace my-project --endpoint cms.cn-shanghai.aliyuncs.com
Basic Operations
# View help
cat /tmp/memory/_help.txt
# List memory stores
ls /tmp/memory/stores/
# Create a new store
mkdir /tmp/memory/stores/my_memories
# Add a memory (WRITE-ONLY, async processing)
echo "User prefers dark mode" > /tmp/memory/stores/my_memories/_add.txt
# Wait 30-60 seconds for processing...
# Search memories (semantic)
cat /tmp/memory/stores/my_memories/search/preferences.txt
# View all memories for a user
cat /tmp/memory/stores/my_memories/users/default_user/_all.txt
# View store info
cat /tmp/memory/stores/my_memories/_info.json
# Delete a memory store
rmdir /tmp/memory/stores/my_memories
Important Notes
_add.txtis WRITE-ONLY: data is sent to API, not stored locally- After writing, memories are processed asynchronously (30-60s delay)
- To view memories, use
search/{query}.txtorusers/{user}/_all.txt - Do NOT
cat _add.txtto check if write succeeded
Unmount
# macOS
umount /tmp/memory
# Linux
fusermount -u /tmp/memory
Directory Structure
/
├── _help.txt # Root help
└── stores/
├── _help.txt # Stores help
└── {store_name}/
├── _info.json # Store configuration (READ-ONLY)
├── _add.txt # Add memories (WRITE-ONLY, async)
├── _help.txt # Store help
├── memories/
│ ├── _help.txt
│ └── {memory_id}.json # Individual memory
├── users/
│ ├── _help.txt
│ └── {user_id}/
│ ├── _all.txt # All user memories (READ)
│ └── _add.txt # Add for user (WRITE)
├── agents/
│ ├── _help.txt
│ └── {agent_id}/...
└── search/
├── _help.txt
└── {query}.txt # Search results (READ)
API Mapping
| Shell Command | CMS AgentLoop Memory API |
|---|---|
mkdir stores/{name} |
CreateMemoryStore |
rmdir stores/{name} |
DeleteMemoryStore |
cat stores/{name}/_info.json |
GetMemoryStore |
echo "text" > stores/{name}/_add.txt |
AddMemories |
cat stores/{name}/search/{query}.txt |
SearchMemories |
cat stores/{name}/memories/{id}.json |
GetMemory |
rm stores/{name}/memories/{id}.json |
DeleteMemory |
ls stores/ |
ListMemoryStores |
For AI Agents
This filesystem is specifically designed to give AI agents persistent memory capabilities using standard shell commands.
We provide ready-to-use prompt templates in the agent_integration/ directory:
- INSTALL_PROMPT.md: Give this instruction to your AI Agent when you want it to automatically install dependencies, configure credentials, and mount the filesystem in its environment.
- USAGE_PROMPT.md: Append this to your AI Agent's System Prompt. It teaches the agent how to actively read, write, and search its memory using bash commands like
ls,cat, andecho. (Note: Before injecting this prompt, make sure to replace the{{YOUR_STORE_NAME}}placeholder with the actual memory store assigned to the agent). - SKILL.md: If you are using an agent framework that supports "Skills" (like Cursor Agent), you can add this folder as a custom skill. The agent will automatically read it when it needs to use memory.
A quick example of what the agent learns to do:
# Agent remembers a user preference
echo "User prefers Python" > /tmp/agentloop_memory/stores/my_agent_store/_add.txt
# Agent recalls information later
cat "/tmp/agentloop_memory/stores/my_agent_store/search/What language does the user prefer.txt"
CLI Reference
agentloop-memory-fs [-h] [-V] [-e FILE] [--endpoint HOST]
[-w NAME] [-p NAME] [--access-key-id ID]
[--access-key-secret SECRET] [-f] [-d]
[--allow-other]
mountpoint
Options:
mountpoint Directory to mount the filesystem
-V, --version Show version
-e, --env FILE Path to .env file
--endpoint HOST CMS endpoint
-w, --workspace NAME CMS workspace name
-p, --project NAME CMS project name (alias for workspace)
--access-key-id ID Alibaba Cloud Access Key ID
--access-key-secret Alibaba Cloud Access Key Secret
-f, --foreground Run in foreground (default)
-d, --debug Enable debug logging
--allow-other Allow other users access
Testing
# Integration tests (requires credentials)
python tests/test_memory_api.py
# E2E tests (requires mounted filesystem)
agentloop-memory-fs /tmp/agentloop_memory &
bash tests/e2e_test.sh
License
MIT License
Metadata
Release files for agentloop-memory-fs 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| agentloop_memory_fs-0.1.0.tar.gz | 19.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agentloop_memory_fs-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 35.7 kB
Release files / agentloop_memory_fs-0.1.0.tar.gz
| Download URL | agentloop_memory_fs-0.1.0.tar.gz |
|---|---|
| Size | 19.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
35e0fd1fd40e48602cfb18e35470a9162112413de035219d545db7214461acf8
|
|
BLAKE2b-256 checksum How to use checksums |
2eb182cd1357430ff3c481434a953a9f6607b26a754fe879724269e3397b4eb9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.5
|
Release files / agentloop_memory_fs-0.1.0-py3-none-any.whl
| Download URL | agentloop_memory_fs-0.1.0-py3-none-any.whl |
|---|---|
| Size | 16.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4b94f7942134afa1b40ae47223ed9dff71c9a42a27ea5294a93059894ef66e6f
|
|
BLAKE2b-256 checksum How to use checksums |
4c5fbcbda131257a2370f68ed8ec74873d1cc2b38f9f05d0096954c13fb229a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.5
|