Skip to content

Configuration

pi22by7 edited this page Nov 12, 2025 · 2 revisions

In Memoria - Configuration Guide

This document explains how to configure the In Memoria application. Configuration is managed through a combination of a config.json file and environment variables.

Configuration Files

config.json

When you run in-memoria setup --interactive or in-memoria init, a configuration directory is created at the root of your project: .in-memoria/. Inside this directory, you will find config.json.

This file contains settings that are specific to the project being analyzed.

Example config.json:

{
  "version": "0.5.4",
  "project": {
    "name": "my-awesome-project",
    "languages": ["typescript", "rust"]
  },
  "intelligence": {
    "enableRealTimeAnalysis": true,
    "enablePatternLearning": true,
    "vectorEmbeddings": true
  },
  "watching": {
    "patterns": ["**/*.ts", "**/*.tsx", "**/*.rs"],
    "ignored": [
      "**/node_modules/**",
      "**/.git/**",
      "**/dist/**",
      "**/build/**",
      "**/target/**"
    ],
    "debounceMs": 500
  },
  "mcp": {
    "serverPort": 3000,
    "enableAllTools": true
  }
}

Key Sections:

  • project: Basic information about the project being analyzed.
  • intelligence: Toggles for core In Memoria features.
    • enableRealTimeAnalysis: If true, the file watcher will analyze changes as they happen.
    • enablePatternLearning: If true, the system will learn and update coding patterns.
    • vectorEmbeddings: If true, enables semantic search capabilities using local embeddings.
  • watching: Configuration for the file watcher.
    • patterns: An array of glob patterns for the files to watch.
    • ignored: An array of glob patterns for files and directories to ignore.
    • debounceMs: The delay (in milliseconds) to wait after a file change before triggering an analysis, to prevent excessive processing while typing.
  • mcp: Settings for the MCP server.
    • serverPort: The port on which the MCP server will listen for connections from AI agents.

Global Configuration (src/config/config.ts)

In addition to the project-specific config.json, there is a global configuration file within the In Memoria source code at src/config/config.ts. This file defines the default values for all settings and manages configuration loading.

This file is not meant to be edited by end-users directly, but it provides a complete reference for all available settings.

InMemoriaConfig Interface

This interface defines the shape of the complete configuration object.

export interface InMemoriaConfig {
  database: {
    filename: string;
    // ...
  };
  performance: {
    batchSize: number;
    maxConcurrentFiles: number;
    // ...
  };
  analysis: {
    supportedLanguages: string[];
    maxFileSize: number; // in bytes
    skipDirectories: string[];
    skipFilePatterns: string[];
  };
  logging: {
    level: 'error' | 'warn' | 'info' | 'debug';
    // ...
  };
}

Environment Variables

You can override many of the default settings using environment variables. This is useful for CI/CD environments or for making temporary adjustments without modifying configuration files.

  • IN_MEMORIA_DB_FILENAME: Overrides the name of the database file (default: in-memoria.db).
  • IN_MEMORIA_BATCH_SIZE: The number of files to process in a single batch during analysis (default: 50).
  • IN_MEMORIA_MAX_CONCURRENT: The maximum number of files to analyze concurrently (default: 10).
  • IN_MEMORIA_REQUEST_TIMEOUT: The timeout in milliseconds for external API requests (default: 30000).
  • IN_MEMORIA_LOG_LEVEL: Sets the logging verbosity. Can be error, warn, info, or debug (default: info).
  • IN_MEMORIA_PERFORMANCE_LOGGING: Set to true to enable detailed performance logging.
  • IN_MEMORIA_VECTOR_DB_PATH: Overrides the path for the vector embeddings database (default: in-memoria-vectors.db).

Environment variables always take precedence over settings in config.json or the default configuration.

Clone this wiki locally