Skip to main content
All Agent Memory configuration lives in a single file: ~/.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

This copies the default .env template to ~/.agentmemory/.env.
2

Open the file and uncomment the settings you want

On Windows, the file lives at %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 all false (or auto-detected) by default. Uncomment the ones you want in ~/.agentmemory/.env.

Tool Visibility

The AGENTMEMORY_TOOLS variable controls how many MCP tools your agent sees:
Use AGENTMEMORY_TOOLS=core if your agent frequently hits context length limits. The 8 core tools cover the vast majority of memory operations.

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:
When you change 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:
Each instance automatically shifts its entire port set by 100, so they never collide. Point each project’s agent at its respective 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:
Once set, every API request must include:
The MCP shim and Agent Memory CLI read AGENTMEMORY_SECRET automatically. For Claude Code and other agents configured via the mcpServers block, pass it in the env section:
Use agentmemory status at any time to see which feature flags are active, which LLM provider is in use, and the current port assignments.