~/.agentmemory/.env. Running agentmemory init creates this file for you from the built-in template. Every setting is optional — Agent Memory runs out of the box with no configuration at all, using sensible defaults for every option.
Quick Setup
1
Create the config file
.env template to ~/.agentmemory/.env.2
Open the file and uncomment the settings you want
%USERPROFILE%\.agentmemory\.env:3
Restart Agent Memory to apply changes
Restart Agent Memory after changing any
.env setting. Environment variables set in your shell take precedence over values in the file.Feature Flags
These flags are allfalse (or auto-detected) by default. Uncomment the ones you want in ~/.agentmemory/.env.
Tool Visibility
TheAGENTMEMORY_TOOLS variable controls how many MCP tools your agent sees:
Ports
Agent Memory binds three public ports by default. You can override each one in~/.agentmemory/.env:
To move the REST API to a different port:
III_REST_PORT, also update AGENTMEMORY_URL so the CLI and MCP shim know where to find the server:
Multi-Instance: Running Multiple Projects Side-by-Side
If you work on multiple projects simultaneously, you can run separate Agent Memory instances — each with its own port set and data directory — using the--instance flag:
AGENTMEMORY_URL.
Security
By default, the REST API is open on loopback (127.0.0.1) with no authentication. If you expose Agent Memory beyond localhost — for example, behind a reverse proxy or in a shared environment — set a bearer secret:
AGENTMEMORY_SECRET automatically. For Claude Code and other agents configured via the mcpServers block, pass it in the env section: