Memorav3.3.0Latest
DocsConfiguration

DocsUse

Configuration

Every Memora setting: environment variables, precedence, instance settings in the web UI, memora-cli options, Docker Compose variables and state files.

On this page

All server state, settings included, lives in one SQLite database, <MEMORA_STATE>/memora.db (see DATABASE.md). Server settings are rows in the server_config table, edited with memora-cli (/config in the console). The process environment (systemd Environment=, Docker environment:) applies to every key that has no row.

Precedence#

For each server setting:

  1. a row in server_config (set with /config), else
  2. the process environment (non-empty value), else
  3. the built-in default.

The server reads server_config once at startup, before anything else, so a change made with /config applies after a restart (/restart for a native install, docker compose restart gateway in Docker). Clearing a value in /config deletes the row, and the environment or default applies again.

A row wins over the environment. If you set MEMORA_PORT with /config and later change the port in the systemd unit or .env, the row still applies until you clear it.

Server settings#

NameDefaultWhere it can liveWhat it does
MEMORA_PORT8400server_config or envHTTP port (API, MCP, web UI, WebSocket). 1-65535.
MEMORA_BIND127.0.0.1server_config or envBind address. 0.0.0.0 for every interface (the container image and the installer set it).
MEMORA_BASE_URLemptyserver_config or envPublic URL, for example https://memora.example.com. Used for OAuth metadata and connection snippets; its host is also an allowed domain.
MEMORA_DOMAINempty (any host)server_config or envAllowed hostnames, comma separated (*.example.com works). Requests for other hosts get 404. Loopback names are always allowed.
MEMORA_TRUSTED_PROXIESemptyserver_config or envIPs of remote reverse proxies whose forwarding headers are trusted. Loopback is always trusted.
MEMORA_ARM_TTL300server_config or envAccepted and validated (30-86400 seconds), but the server and memora-cli do not read it: the setup / reset window length comes from memora-cli --minutes (default 5 minutes).
MEMORA_VAULTempty (data as last resort)server_config or envSuggested vault folder. The vault in use is chosen in the browser (or with memora-cli vault) and stored in the settings table.
MEMORA_VAULT_AUTOfalseserver_config or envtrue (also 1, yes, on): use MEMORA_VAULT at startup instead of asking in the browser, only while no vault is configured and if the folder is writable.
MEMORA_ADMIN_USERadminserver_config or envName of the owner created at startup when no owner exists (needs MEMORA_ADMIN_PASSWORD).
RUST_LOGinfoserver_config or envLog filter, for example info or memora=debug.

server_config accepts only these ten keys. Values are trimmed and validated (numbers in range, true/false, a valid user name, no control characters, at most 2048 bytes).

Environment only#

NameDefaultWhat it does
MEMORA_ADMIN_PASSWORD, MEMORA_ADMIN_PASSWORD_FILEunsetCreates the owner at startup when none exists (at least 10 characters). Only the argon2id hash is stored; an existing owner is never replaced.
MEMORA_API_KEY, MEMORA_API_KEY_FILEunsetInstalls an agent API key with id k_env and scopes mcp, read, write (at least 24 characters). Only its SHA-256 is stored; the key is replaced when the value changes.
MEMORA_STATEstate (relative to the working directory)State directory holding memora.db. Created with mode 0700 if missing.
MEMORA_ASSETSthe crates/http/assets folder of the build treeDirectory of the web UI assets.
MEMORA_INSTALLset by the npm launcher (npm) and the Docker image (docker)How this copy was installed: npm, docker, native, zip or source. memora-cli update, start, stop, restart and uninstall use it to pick the right steps; when unset they work it out from the program's path.
MEMORA_SETUP_HINTmemora-cli setup (run on the server)Hint returned by GET /api/auth/state and shown on the login screen.
MEMORA_UPDATE_CHECKtrueRelease check: shortly after start and then every 6 hours the server asks GitHub (api.github.com/repos/Codrihub/memora/releases/latest) for the newest release and the web UI shows when an update is available (Settings › Version, a card on Overview, and once per version a small card at the top of the page that waits for a calm moment and steps aside by itself). The same check reads the repository's star count (api.github.com/repos/Codrihub/memora), shown in What's new. false (also 0, no, off) turns both off; no network call is made.

The two secrets can never be stored in server_config (the schema rejects them). The _FILE variants read the value from a file, for example a Docker secret; a non-empty file wins over the plain variable.

In /config, MEMORA_API_KEY offers to create an API key directly, and MEMORA_ADMIN_PASSWORD points to /setup or /reset.

Instance settings (web UI)#

The settings table holds one row, edited from the Settings page of the web UI:

KeyDefaultRangeWhat it does
realmMemora1-64 charactersInstance name shown in the UI and reported by /api/config and /api/auth/state.
session_ttl10800 (3 hours)300-2592000 secondsIdle timeout of a browser session: any use renews it (requests, and an open tab in use).
session_max_age00 or at least session_ttlAbsolute session lifetime in seconds. 0 means no cap.
min_password_len1010-256Minimum owner password length.
log_max_mb81-512Size limit in MB of the vault event log (.events.jsonl).
log_max_days00-3650Age limit in days of the vault event log. 0 means no age limit.
vault_pathunsetabsolute pathThe vault folder. Set in the browser after the first sign-in, or with memora-cli vault PATH.

Two more settings live in the ui_layout table and in a file beside the database:

SettingDefaultWhereWhat it does
Largest image5 MBSettings, Images (POST /api/settings/media, admin); stored as the srv-media documentUploads above this size are refused, from the app, the HTTP API and MCP upload_image alike. 0.1 to 50 MB.
Mnemonot set upSettings, Mnemo, or /mnemo setup in the console; stored in assistant.sqlite3Providers (OpenAI, Anthropic, one OpenAI-compatible server) with sealed API keys, models (pinned, hidden, default, context window and reply limit), temperature, reply and context limits, tool steps per reply, your instructions, and the floating button.

memora-cli options#

OptionDefaultWhat it does
--state <DIR>$MEMORA_STATE, else the state directory of the running memora server, else ./stateState directory to work on.
--minutes <N>5Window length for setup and reset-password, 1-60.
--ttl <SECONDS>Window length in seconds (at most 3600). --minutes wins when both are given.
--createWith vault PATH: create the folder if it does not exist.

Run as root, memora-cli does all database work as the owner of the state directory, so no root-owned memora.db* files appear. See INSTALL.md and DEPLOYMENT.md for the commands.

Docker Compose (.env)#

These variables are read by docker-compose.yml, not by Memora itself:

NameDefaultWhat it does
COMPOSE_PROJECT_NAMEmemoraCompose project name, also the container name prefix.
IMAGEghcr.io/codrihub/memora:<version>Image to run or build. The compose file pins the release it ships with.
MEMORA_HTTP_PORT8400Host port mapped to the container's port 8400. Use 127.0.0.1:8400 to publish on loopback only.
MEMORA_DATA_DIR./dataHost path mounted at /data (the vault).
MEMORA_STATE_DIR./stateHost path mounted at /state (the state directory).
MEMORA_UID, MEMORA_GID1000uid:gid the container runs as. Must own both host directories.
MEMORA_ARM_TTL300Passed to the container unchanged.

Compose also passes these through from .env to the container: MEMORA_BASE_URL, MEMORA_DOMAIN, MEMORA_TRUSTED_PROXIES, MEMORA_VAULT_AUTO, MEMORA_ADMIN_USER, MEMORA_ADMIN_PASSWORD, MEMORA_ADMIN_PASSWORD_FILE, MEMORA_API_KEY, MEMORA_API_KEY_FILE, MEMORA_SETUP_HINT, MEMORA_UPDATE_CHECK, and RUST_LOG.

Inside the container the image sets MEMORA_VAULT=/data, MEMORA_STATE=/state, MEMORA_PORT=8400, MEMORA_BIND=0.0.0.0, MEMORA_ARM_TTL=300, MEMORA_ASSETS=/app/assets, MEMORA_INSTALL=docker, and RUST_LOG=info.

State directory#

PathContent
memora.db (+ -wal, -shm)The state database: owner, API keys (hashes), tool switches and per-key permissions, OAuth clients and grants, privacy rules, sessions (hashed ids), setup window and lock state, access rules, settings, server_config, activity log. Mode 0600, WAL mode, must be on a local filesystem. See DATABASE.md.
key-seal.bin32-byte master key (mode 0600) that encrypts the copies of dashboard-created API keys, so the owner can show a key again. Created on first use. Back it up together with memora.db.
assistant.sqlite3 (+ -wal, -shm)Mnemo, the built-in agent: providers (API keys sealed with key-seal.bin), models, preferences, chats and messages. Mode 0600. Separate from memora.db, so the main schema is unchanged; delete it to forget every Mnemo chat and key. Back it up with memora.db if you want to keep chats.
backups/memora-cli db backup output (newest 10 kept by default).
exchange/Zips written by the export_memory MCP tool and read by import_memory (mode 0700, created on first use). Private to this instance; delete old zips when no longer needed.
legacy-json-<unix time>/JSON state files found at startup, moved here after their one-time import into memora.db.
internal.tokenCreated by the Docker entrypoint. Not used by Memora.

Vault files#

The vault holds the markdown notes plus derived and metadata files. See ARCHITECTURE.md for the full list. The important ones for operations are .git/ (history), .events.jsonl (event log), and .Trash/ (soft-deleted notes; .Trash/.index.json remembers where each one came from, so restore_trash puts it back there; .Trash/.assets/<entry>/ keeps the images of a trashed note until it is restored or deleted for good). Images uploaded to a note are ordinary files in the note's folder.

Version history#

Version history (get_history, get_note_at, diff, restore_memory, snapshot) is on when the vault folder is a git repository of its own, that is when it has a .git/ directory. Memora does not create one, so a new vault has no history and these tools answer "version history is off". To turn it on, install git and run, once:

sh
git -C /path/to/vault init
git -C /path/to/vault add -A
git -C /path/to/vault commit -m "start history"

(In Docker, the vault is the host directory mounted at /data.) From then on every change made through Memora is committed automatically. Each commit's author is the agent or user whose call made the change; the committer is the vault's git identity (git config user.name / user.email), or Memora <memora@localhost> when none is set. Git never searches above the vault, so a vault inside another repository still needs its own git init.

A snapshot (snapshot tool) commits pending changes and tags the last commit as snap-<label>; pass that tag as rev to get_note_at, diff or restore_memory.

Deleting a note for good (Delete forever or Empty trash in the app, /api/trash/delete, /api/trash/empty, delete_memory with permanent) also erases it from the history: Memora rewrites the vault's git history so no commit, snapshot tag or object keeps its text, any name it had, its trash record or its path in a commit message, then expires the reflog and runs git gc --prune=now. Other notes keep all their versions, but their revision ids change, so old revision ids (and clones or pushes of the vault made before) no longer match. Moving a note to the Trash keeps its history.