Skip to main content

.shaktiman/shaktiman.toml

Shaktiman reads configuration from .shaktiman/shaktiman.toml in your project root. All fields are optional — defaults (listed below) apply when a key is missing or the file is absent.

Precedence (highest wins):

  1. CLI flags (e.g. --vector hnsw)
  2. Environment variables (SHAKTIMAN_POSTGRES_URL, SHAKTIMAN_QDRANT_API_KEY)
  3. .shaktiman/shaktiman.toml
  4. Built-in defaults

If the file doesn't exist, shaktimand writes a sample one on startup (commented out). You can also generate it explicitly with shaktiman init <project-root>.

Sections

[database]

FieldDefaultAllowedNotes
backend"sqlite""sqlite", "postgres"Metadata backend. postgres requires the postgres build tag.

[postgres]

Used only when [database].backend = "postgres".

FieldDefaultValidationNotes
connection_stringrequired with postgresOverride via env SHAKTIMAN_POSTGRES_URL.
max_open_conns20>= 1pgx pool max open connections.
max_idle_conns10>= 0pgx pool max idle connections.
schema"public"Postgres schema name.

Defaults for the search MCP tool (and shaktiman search CLI).

FieldDefaultValidationNotes
max_results101–200Also used as DefaultMaxResults.
default_mode"locate""locate" or "full"Clients may override per-call.
min_score0.150.0–1.0Relevance score floor; raise to reduce noise.

[context]

Defaults for the context MCP tool.

FieldDefaultValidationNotes
enabledtrueboolSet false to hide the context tool entirely.
budget_tokens4096256–32768Default assembly budget. Also bounds MaxBudgetTokens.

[vector]

FieldDefaultAllowedNotes
backend"brute_force""brute_force", "hnsw", "qdrant", "pgvector"qdrant needs the qdrant build tag; pgvector needs the pgvector tag and postgres metadata.

[qdrant]

Used only when [vector].backend = "qdrant".

FieldDefaultNotes
urlRequired with qdrant. Example: http://localhost:6334.
collection"shaktiman"Collection name.
api_keyOverride via env SHAKTIMAN_QDRANT_API_KEY (recommended).

[embedding]

FieldDefaultValidationNotes
ollama_urlhttp://localhost:11434Base URL for the Ollama HTTP API.
model"nomic-embed-text"Must match the model Ollama can serve.
dims7681–4096Must match the model's embedding dimensionality.
batch_size128>= 1Texts per /api/embed request.
timeout"120s"Go durationHTTP timeout per batch.
query_prefix""Prepended to queries before embedding. Use "search_query: " with nomic-embed-text.
document_prefix""Prepended to chunks before embedding. Use "search_document: " with nomic-embed-text.

[test]

FieldDefaultNotes
patternsper-language (see below)Glob patterns (*_test.go) and directory prefixes (testdata/). Auto-populated after first index if absent.

Auto-populated language defaults (merged across indexed languages):

LanguagePatterns
Go*_test.go, testdata/
Pythontest_*.py, *_test.py
TypeScript*.test.ts, *.spec.ts, *.test.tsx, *.spec.tsx, __tests__/
JavaScript*.test.js, *.spec.js, *.test.jsx, *.spec.jsx, *.test.mjs, *.spec.mjs, __tests__/
Java*Test.java, *Tests.java, src/test/
Rusttests/
Bashtest_*.sh, *_test.sh
Ruby*_test.rb, test_*.rb, *_spec.rb, spec/, test/

Patterns ending in / match directory prefixes; everything else is a basename glob.

Fields not set via TOML

These ship from DefaultConfig and today are not tunable via shaktiman.toml (they're either derived or intentionally fixed):

FieldDefaultWhat it's for
DBPath<root>/.shaktiman/index.dbMetadata DB path (SQLite).
EmbeddingsPath<root>/.shaktiman/embeddings.binPersisted vectors for local backends.
MaxBudgetTokens4096Bounded by [context].budget_tokens when set.
DefaultMaxResults10Overridden by [search].max_results.
WriterChannelSize500SQLite writer queue depth.
EnrichmentWorkers4Parallel parser workers.
Tokenizercl100k_baseTokenizer for budget accounting.
WatcherEnabledtrueFile-save re-index.
WatcherDebounceMs200Coalesce watcher events.
EmbedEnabledtrueRun the embedding worker on the daemon path (requires Ollama reachable). The CLI shaktiman index ignores this flag — see Embeddings → Daemon vs CLI indexing.

If you need to change these, the source of truth is internal/types/config.go:DefaultConfig — add a TOML key there if a use case emerges.

Environment variables

VariableOverrides
SHAKTIMAN_POSTGRES_URL[postgres].connection_string
SHAKTIMAN_QDRANT_API_KEY[qdrant].api_key

Secrets belong in env, not in TOML.

Backend-combination rules

ValidateBackendConfig runs after the config is fully merged and rejects unsupported combinations:

  • [vector].backend = "pgvector"[database].backend must be "postgres".
  • [database].backend = "postgres"[postgres].connection_string (or SHAKTIMAN_POSTGRES_URL) must be set.
  • [vector].backend = "qdrant"[qdrant].url must be set.
  • [database].backend = "postgres" forbids [vector].backend = "brute_force" or "hnsw" — file-backed stores race on embeddings.bin when two daemons share the same Postgres database (ADR-003 A12).

Source of truth

  • internal/types/config.goConfig struct, DefaultConfig, LoadConfigFromFile, ValidateBackendConfig, WriteSampleConfig.
  • internal/types/config.golangTestPatterns for auto-populated test globs.