Skip to main content
The daemon configuration controls how the LongMem background service operates, including the network port, database location, logging level, and authentication.

Configuration

Daemon settings are configured in the daemon section of ~/.longmem/settings.json:
{
  "daemon": {
    "port": 38741,
    "dbPath": "~/.longmem/memory.db",
    "logLevel": "warn",
    "authToken": null
  }
}

Configuration fields

port

  • Type: number
  • Default: 38741
The TCP port where the daemon listens for client connections. The daemon binds to 127.0.0.1 (localhost only) for security. Example:
{
  "daemon": {
    "port": 38741
  }
}
If you change the port, you’ll need to restart the daemon and ensure clients connect to the new port.

dbPath

  • Type: string
  • Default: ~/.longmem/memory.db
Path to the SQLite database file where memories are stored. Supports tilde (~) expansion for the home directory. Example:
{
  "daemon": {
    "dbPath": "~/custom/path/memories.db"
  }
}
Changing dbPath will create a new empty database. Your existing memories will remain in the old location but won’t be accessible until you change the path back or migrate the database file.

logLevel

  • Type: "debug" | "info" | "warn" | "error"
  • Default: "warn"
Controls the verbosity of daemon logs. Logs are written to ~/.longmem/logs/. Log levels:
  • debug - Verbose output for troubleshooting
  • info - General informational messages
  • warn - Warning messages only (default)
  • error - Error messages only
Example:
{
  "daemon": {
    "logLevel": "debug"
  }
}
Use "debug" level when troubleshooting issues or reporting bugs. Remember to restart the daemon after changing the log level.

authToken

  • Type: string | null
  • Default: null (no authentication)
Optional authentication token required for clients to connect to the daemon. When set, clients must provide this token to authenticate. Example:
{
  "daemon": {
    "authToken": "your-secret-token-here"
  }
}

When to use authToken

The authToken setting provides an additional security layer. Consider using it when:
  • Multi-user systems: If multiple users share the same machine and you want to prevent unauthorized access to your memory database
  • Extra security: If you store sensitive information in memories and want defense-in-depth
  • Shared development environments: In containerized or shared development setups
The daemon already binds to 127.0.0.1 (localhost only), so it’s not accessible from other machines on the network. An auth token is optional but recommended for multi-user systems.

Examples

Minimal configuration

Use all defaults:
{
  "daemon": {}
}

Custom port and debug logging

{
  "daemon": {
    "port": 45000,
    "logLevel": "debug"
  }
}

Secure multi-user setup

{
  "daemon": {
    "port": 38741,
    "dbPath": "~/.longmem/memory.db",
    "logLevel": "warn",
    "authToken": "randomly-generated-secure-token-12345"
  }
}

Applying changes

After modifying daemon configuration:
  1. Save ~/.longmem/settings.json
  2. Restart the daemon:
    longmem stop
    longmem start
    
  3. Verify the daemon is running with new settings:
    longmem status
    

Build docs developers (and LLMs) love