Skip to main content
OpenGround uses a JSON configuration file to manage settings for database paths, embedding models, query parameters, and more.

Configuration File Location

OpenGround stores configuration at:
Or if XDG_CONFIG_HOME is set:
The config file is automatically created with default values when you first run any openground command.

View Configuration

Display your current configuration:

View Defaults Only

See hardcoded default values (ignoring your custom settings):

Get Config File Path

Print the path to the config file:

Default Configuration

OpenGround uses these defaults:

Set Configuration Values

Modify configuration settings using the config set command:
Use dot notation for nested keys:

Configuration Examples

Values are automatically parsed as JSON. For booleans and numbers, just type the value. For strings with spaces, use quotes.

Get Configuration Values

Retrieve a specific configuration value:

Get Examples

Reset Configuration

Delete your config file and restore defaults:
With confirmation skip:
This permanently deletes your custom configuration. You cannot undo this action.

Configuration Settings Reference

Database Settings

string
default:"~/.local/share/openground/lancedb"
Path to LanceDB database directory. Stores embeddings and vector indexes.
string
default:"documents"
Name of the LanceDB table for storing document chunks.
string
default:"~/.local/share/openground/raw_data"
Directory for storing extracted JSON files before embedding.

Extraction Settings

integer
default:"50"
Maximum number of concurrent HTTP requests during sitemap extraction. Higher values extract faster but use more resources.

Embedding Settings

integer
default:"32"
Number of text chunks to embed in each batch. Larger batches are faster but use more memory.
integer
default:"800"
Maximum number of characters per chunk when splitting documents. Affects embedding granularity.
integer
default:"200"
Number of overlapping characters between consecutive chunks. Helps maintain context across chunk boundaries.
string
default:"BAAI/bge-small-en-v1.5"
Name of the embedding model from Hugging Face. Must match the embedding backend.
integer
default:"384"
Dimensionality of embedding vectors. Must match the model’s output dimensions.
string
default:"fastembed"
Backend for generating embeddings. Options: "fastembed" or "sentence-transformers"

Query Settings

integer
default:"5"
Default number of search results to return. Can be overridden with --top-k flag.

Source Settings

boolean
default:"true"
Automatically save library sources to ~/.openground/sources.json when adding libraries with --source flag.
string
Custom path to sources.json file. If not set, uses standard search order (project → user → package).

Embedding Backend Options

OpenGround supports two embedding backends:

FastEmbed (Default)

Advantages:
  • ✅ Faster inference
  • ✅ Lower memory usage
  • ✅ Optimized for CPU
  • ✅ No dependency on PyTorch
Models: Uses ONNX-optimized models

Sentence Transformers

Advantages:
  • ✅ More model options
  • ✅ Better GPU support
  • ✅ Active development
  • ✅ Widely used
Models: Uses standard Hugging Face models
Changing the embedding backend requires re-embedding all libraries. Delete existing libraries and re-add them after changing backends.
  1. Set the new model:
  1. Delete existing embeddings:
  1. Re-embed your libraries:
Note: Make sure embedding_dimensions matches your model’s output size.

Chunking Configuration

Chunking parameters affect how documents are split before embedding:
Larger chunks (800-1200 chars):
  • Better context preservation
  • Fewer total chunks (faster indexing)
  • May include irrelevant content
  • Good for conceptual queries
Smaller chunks (400-600 chars):
  • More precise results
  • Better for specific queries
  • More chunks (slower indexing)
  • May lose broader context
Overlap (150-300 chars):
  • Prevents information loss at boundaries
  • Higher overlap = more context retention
  • Higher overlap = more chunks
Recommendation: Start with defaults (800/200) and adjust based on your documentation structure.

Source File Configuration

OpenGround searches for library source configurations in this order:
  1. Custom path (if provided via --sources-file or sources.file_path)
  2. Project-local: ./.openground/sources.json
  3. User home: ~/.openground/sources.json
  4. Package-level: openground/extract/sources.json

Disable Auto-Add to Sources

By default, when you add a library with --source, it’s saved to ~/.openground/sources.json:

Custom Sources File

Environment Variables

OpenGround respects XDG Base Directory specification:

Configuration in Python

Access configuration from Python code:

Advanced Configuration Examples

High-Performance Setup

High-Quality Setup

Custom Storage Setup

Large-Scale Setup

High concurrency and batch sizes require more memory and network bandwidth. Monitor resource usage when increasing these values.

Configuration Best Practices

1

Start with Defaults

Use default settings initially and only customize when needed:
2

Test Before Committing

Test configuration changes on a small library before re-embedding large libraries:
3

Document Custom Settings

Keep a record of why you changed settings:
4

Version Control

For team projects, commit .openground/sources.json to version control:
No - config.json is user-specific and contains local paths. It should not be committed.Yes - .openground/sources.json is project-specific and can be shared with your team.
Existing embeddings use the old chunk_size. They won’t automatically update. To apply new chunking:
  1. Change the setting:
  1. Delete and re-add libraries:
Or use nuke for all libraries:
Yes! Use project-local sources:
Each project can have different source configurations.

Troubleshooting

Clear the config cache:
Or restart your Python process/terminal.
Your config file has syntax errors. View it:
Fix JSON syntax or reset:
Check directory permissions:
Fix permissions:

Next Steps

Querying

Use your configured settings to query documentation

Adding Libraries

Add libraries using custom configuration