Documentation

Configuration

Customize how Forage indexes your project and runs its servers.

Config files

Forage uses two config files:

  • Global config~/.forage/config.json — applies to all workspaces. Created automatically on first run.
  • Workspace config{workspace}/.forage/config.json — per-project overrides. Most fields are null by default, meaning they inherit the global value.

The easiest way to edit these is through the Forage web UI at http://localhost:9988Settings. Forage automatically generates its API key on first run — do not edit the apiKey field manually.

Global config template with all available options:

~/.forage/config.json
{
  "port": 9988,
  "mcpPort": 9989,
  "listenOnAllInterfaces": false,
  "corsOrigins": "",
  "apiKey": "<auto-generated>",
  "ollama": {
    "url": "http://localhost:11434",
    "apiKey": "",
    "model": "llama3",
    "reasoningEffort": "medium",
    "codingModel": "",
    "codingUrl": "",
    "codingApiKey": "",
    "codingReasoningEffort": "medium",
    "modelParams": {},
    "codingModelParams": {}
  },
  "chat": {
    "autoCompactAt": 75,
    "keepFirstMessages": 2,
    "keepLastMessages": 6
  },
  "snapshots": {
    "heartbeatIntervalMinutes": 30
  },
  "annotations": {
    "heartbeatIntervalMinutes": 0,
    "batchSize": 5
  },
  "agentAutonomy": "supervised",
  "workspacesDir": "",
  "services": {
    "watchFiles": true,
    "mcpServer": true,
    "startOnBoot": false
  },
  "proxy": {
    "enabled": false,
    "protocol": "http",
    "host": "",
    "port": 0,
    "username": "",
    "password": ""
  },
  "google": {
    "clientId": "",
    "clientSecret": ""
  }
}

Options reference

Servers

OptionTypeDefaultDescription
port number 9988 Port for the Forage web UI.
mcpPort number 9989 Port for the MCP server. Update your agent configs when changing this.
listenOnAllInterfaces boolean false Bind servers to 0.0.0.0 instead of 127.0.0.1. Required if you need to reach Forage from another machine on your network.
corsOrigins string "" Comma-separated list of allowed CORS origins. Leave blank to restrict to same-origin requests only.

AI providers

Forage talks to four kinds of model backends: a local Ollama server, or the hosted OpenAI, Anthropic (Claude), and Google Gemini APIs. chatProvider and codingProvider each independently select which one serves the Chat Model (Graph page AI chat, the ask MCP tool) and the Coding Model (Editor code assistant, the code_task MCP tool) — you can mix them, e.g. Claude for chat and a local Ollama model for coding.

OptionTypeDefaultDescription
chatProviderstring"ollama"Which provider serves the Chat Model: "ollama", "openai", "anthropic", or "gemini".
codingProviderstring"ollama"Which provider serves the Coding Model. Set independently from chatProvider.

Ollama

OptionTypeDefaultDescription
ollama.urlstringhttp://localhost:11434Ollama server URL for the Chat Model.
ollama.apiKeystring""API key for the Chat Model server (required if using a hosted Ollama-compatible endpoint).
ollama.modelstring"llama3"Ollama model name for the Chat Model.
ollama.reasoningEffortstring"medium"Reasoning effort for gpt-oss models: "low", "medium", or "high". Ignored for other models.
ollama.codingModelstring""Model name for the Coding Model. Falls back to model if blank.
ollama.codingUrlstring""Server URL for the Coding Model. Falls back to url if blank.
ollama.codingApiKeystring""API key for the Coding Model server. Falls back to apiKey if blank.
ollama.codingReasoningEffortstring"medium"Reasoning effort for the Coding Model. Falls back to reasoningEffort if blank.
ollama.modelParamsobject{}Extra Ollama options for the Chat Model (e.g. { "temperature": 0.7, "top_p": 0.9, "top_k": 40, "repeat_penalty": 1.1, "num_predict": 2048, "seed": 42 }). Leave empty to use model defaults.
ollama.codingModelParamsobject{}Extra Ollama options for the Coding Model. Independent of modelParams.

OpenAI / Anthropic / Gemini

These three are API-key-only providers (no OAuth/login flow) and share the same shape: apiKey and model for the Chat Model, plus optional codingModel / codingApiKey overrides for the Coding Model — same fallback behavior as the Ollama block above.

OptionTypeDefaultDescription
openai.apiKey / anthropic.apiKey / gemini.apiKeystring""API key for that provider's Chat Model.
openai.model / anthropic.model / gemini.modelstring""Model name, e.g. "gpt-4.1", "claude-sonnet-5", "gemini-2.0-flash".
*.codingModelstring""Separate model for the Coding Model. Falls back to model if blank.
*.codingApiKeystring""Separate API key for the Coding Model. Falls back to apiKey if blank.
~/.forage/config.json — Claude for chat, local Ollama for coding
{
  "chatProvider": "anthropic",
  "codingProvider": "ollama",
  "anthropic": {
    "apiKey": "sk-ant-...",
    "model": "claude-sonnet-5"
  },
  "ollama": {
    "url": "http://localhost:11434",
    "codingModel": "gpt-oss:32b"
  }
}

Chat

OptionTypeDefaultDescription
chat.autoCompactAtnumber75Percentage of context window used before Forage auto-compacts the chat history.
chat.keepFirstMessagesnumber2Number of opening messages to preserve when compacting.
chat.keepLastMessagesnumber6Number of most-recent messages to preserve when compacting.

Snapshots & Annotations

OptionTypeDefaultDescription
snapshots.heartbeatIntervalMinutesnumber30How often Forage automatically creates a snapshot (in minutes). Set to 0 to disable.
annotations.heartbeatIntervalMinutesnumber0How often Forage runs AI annotation of source files (in minutes). 0 = disabled (LLM calls have a cost).
annotations.batchSizenumber5Number of files annotated per annotation run.

Agent & Services

OptionTypeDefaultDescription
agentAutonomystring"supervised""supervised" — the Editor's coding agent queues jobs and waits for your approval before writing to disk. "auto" — agent completes jobs end-to-end without pausing.
workspacesDirstring""Default directory suggested when cloning a new workspace.
services.watchFilesbooleantrueWatch workspace directories for file changes and update the graph incrementally.
services.mcpServerbooleantrueRun the MCP server alongside the web UI.
services.startOnBootbooleanfalseRegister Forage as a system startup item.

Proxy

OptionTypeDefaultDescription
proxy.enabledbooleanfalseRoute outbound requests through a proxy.
proxy.protocolstring"http""http" or "https".
proxy.hoststring""Proxy hostname or IP.
proxy.portnumber0Proxy port.
proxy.usernamestring""Proxy username (if required).
proxy.passwordstring""Proxy password (if required).

Google (optional)

Required only if you want to export documentation to Google Docs. Obtain credentials from the Google Cloud Console.

OptionTypeDefaultDescription
google.clientIdstring""Google OAuth 2.0 Client ID.
google.clientSecretstring""Google OAuth 2.0 Client Secret.

Workspace config

Each workspace can override a subset of the global config. A null value means "inherit from global".

{workspace}/.forage/config.json
{
  "name": "my-project",
  "ollama": null,
  "chatProvider": null,
  "codingProvider": null,
  "openai": null,
  "anthropic": null,
  "gemini": null,
  "testCommand": null,
  "agentAutonomy": null,
  "snapshots": null,
  "annotations": null
}
OptionDescription
nameDisplay name for this workspace in the Forage UI.
ollamaPer-workspace Ollama override. Same shape as the global ollama object. null = inherit global.
chatProvider / codingProviderPer-workspace override of which provider (ollama/openai/anthropic/gemini) serves that role. null = inherit the global default.
openai / anthropic / geminiPer-workspace override for that provider, same shape as the matching global block. null = inherit global.
testCommandShell command to run after the coding agent applies changes (e.g. "npm test"). Output streams into the editor chat. null = skip.
agentAutonomyPer-workspace override for "supervised" / "auto". null = inherit global.
snapshotsPer-workspace snapshot interval override. null = inherit global.
annotationsPer-workspace annotation settings override. null = inherit global.

Using a local AI model

Ollama remains the default provider and the only fully local, zero-data-egress option — Forage also supports hosted OpenAI, Anthropic, and Gemini models (see AI providers above) for teams that prefer them, but those send code context to that provider's API. For a fully air-gapped setup, leave chatProvider/codingProvider at "ollama", set ollama.url to your Ollama server, and choose a model:

~/.forage/config.json — Ollama example
{
  "ollama": {
    "url": "http://localhost:11434",
    "model": "gpt-oss:120b",
    "codingModel": "gpt-oss:32b"
  }
}
With a local Ollama server, and with the exception of the remote Forage licensing server, Forage operates with zero outbound network connections. See the Security page for the full data flow.

.forageIgnore

You can also create a .forageIgnore file in your project root (same syntax as .gitignore) to exclude paths from indexing without editing the config file:

.forageIgnore
# Vendor code
vendor/
third_party/

# Generated files
*.pb.go
*.generated.ts

# Large data files
fixtures/
testdata/large/