Brokspace

Configuration reference

Esta página ainda não foi traduzida; ela aparece em inglês.

brok init writes .brokspace/brok.yml with comments (commands that change the file, like brok setup llm, keep them; comments you add yourself are dropped when brok rewrites the file). Every key is optional; missing keys take the defaults below. Unknown keys are rejected with a "did you mean" style error, so typos never go unnoticed.

Changes take effect on the next command (or after restarting brok run). brok config get [key], brok config set <key> <value> and brok config unset <key> read and change the file from scripts and editors, with the same validation. Changing embeddings.model, embeddings.dimensions or index.store triggers a rebuild of the affected partitions on the next brok index.

workspace

KeyDefaultDescription
submodulestrueIndex git submodules and git repositories nested in the workspace (up to 4 levels, e.g. a folder of repos) as independent hot partitions.
links{}Workspaces this one depends on, by name: their code and memories are searched too. Manage them with brok link; see Memory and linked workspaces.

Each links.<name> entry:

KeyDefaultDescription
pathA directory, absolute or relative to this workspace's root. Set path or git.
gitA git URL, cloned into .brokspace/links/<name>/src/ by brok link sync.
branchremote defaultBranch of a git link.
descriptionWhat it is and how this workspace uses it; searched, so the LLM learns about the dependency.
memorytrueAlso search its memories.

index

KeyDefaultDescription
include["**/*"]Globs (relative to the workspace root) of files to index.
exclude.git, .brokspace, target, node_modules, dist, build, lock files (*.lock, pnpm-lock.yaml, package-lock.json, npm-shrinkwrap.json, go.sum), *.min.jsGlobs to skip. .gitignore files are always honored on top of this.
max_file_kb512Larger files are skipped. Binary files (NUL bytes) and non UTF-8 files are always skipped.
max_chunk_lines120A syntactic unit longer than this is split: containers into members, other nodes at line boundaries.
storeautoauto (LanceDB when compiled in), lancedb or arrow (memory-mapped Arrow IPC, exact vector search).

embeddings

KeyDefaultDescription
enabledtruefalse runs on BM25 text search only: no download, minimal memory.
modelnomic-embed-text-v1.5The only supported model today.
variantquantizedquantized (~140 MB, int8) or full (~550 MB, fp32).
dimensions768Matryoshka truncation: 64, 128, 256, 512 or 768.
deviceautoauto, cpu, cuda, coreml, directml (GPU devices need the matching build feature).
batch_size16Texts per inference batch.

Model files are downloaded once per user and shared by every workspace: ~/.cache/brokspace/models (Linux), ~/Library/Caches/brokspace/models (macOS), %LOCALAPPDATA%\brokspace\models (Windows). Set BROK_MODELS_DIR to use another directory. A copy inside .brokspace/cache/models/ (from older versions) keeps working.

User defaults

brok setup llm also stores your LLM choice in the user configuration (~/.config/brokspace/config.yml, ~/Library/Application Support/brokspace/ or %APPDATA%\brokspace\; override with BROK_CONFIG_DIR). brok init applies it to every new workspace, so you choose a model once per machine.

KeyDefaultDescription
limit8Default number of results.
cold_weight0.85Score multiplier for partitions other than the one you run the command from.
link_weight0.8Score multiplier for results from linked workspaces.

memory

KeyDefaultDescription
enabledtrueSearch memories with the code and let brok memory, the VS Code extension and MCP tools save them.
sessionstrueSave editor chat sessions as session memories.
globaltrueSearch your global memories (every workspace) here too.

See Memory and linked workspaces for where memories live and how they are captured.

metrics

KeyDefaultDescription
enabledtrueRecord timings and counts of searches, answers, indexing and errors in .brokspace/metrics/. They never leave the machine; brok stats shows them.
retention_days90Older months are deleted when brok starts (1 to 3650).

See Troubleshooting, metrics and bug reports for what is recorded.

llm

OpenAI-compatible chat completion endpoints used by brok-agent.

llm:
  default: ollama
  providers:
    ollama: { base_url: http://localhost:11434/v1, model: qwen2.5-coder:7b }
    lmstudio: { base_url: http://localhost:1234/v1, model: qwen2.5-coder-7b-instruct }
    anthropic:
      base_url: https://api.anthropic.com/v1
      model: claude-sonnet-5-5
      api_key_env: ANTHROPIC_API_KEY
      max_tokens: 2048
KeyDescription
defaultProvider used unless brok ask --provider says otherwise. Must exist in providers.
providers.<name>.base_urlURL up to and including /v1.
providers.<name>.modelModel name as the provider expects it.
providers.<name>.api_key_envName of the environment variable holding the key. Keys never go in this file.
providers.<name>.temperature / max_tokensOptional sampling settings.

sync

Where the index is mirrored, configured with brok setup sync.

KeyDescription
backendnone, s3, r2, minio or git-lfs.
remote.bucket / prefix / region / endpointObject storage coordinates.
remote.access_key_env / secret_key_envNames of the variables holding the credentials (default AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY).

git-lfs tracks .brokspace/databases/** with Git LFS and stops ignoring it, so the index travels with the repository. The object storage sync engine (brok sync) is on the roadmap: today brok setup sync records the target.

shards

shards:
  brok-agent:
    enabled: true # brok run starts it (shards not listed are enabled)
    settings: # free-form, handed to the shard when it connects
      watch_interval_secs: 5

Each shard documents its own settings. For brok-agent see its README.

Environment variables

VariableUsed byPurpose
RUST_LOGallLog filter, e.g. RUST_LOG=brok_index=debug.
NO_COLORCLIDisable colors.
BROK_MODELS_DIRCLIEmbedding model cache (default: the OS cache directory).
BROK_CONFIG_DIRCLIUser defaults directory (default: the OS config directory).
BROK_* (others)shardsSet by brok run for shard processes; reserved.

Nesta página