Skip to content

Configuration

Polymathy is configured through environment variables. This guide covers all available options.

Environment Variables

Required Variables

Variable Description Example
SEARXNG_URL URL of your SearxNG search instance http://searx.example.com/search
PROCESSOR_URL URL of the content processor service http://processor:8081/v1/process

Optional Variables

Variable Description Default
SERVER_HOST Host address to bind the server 127.0.0.1
SERVER_PORT Port to listen on 8080

Example Configuration

Development

# .env - Development configuration
SEARXNG_URL=http://localhost:8888/search
PROCESSOR_URL=http://localhost:8081/v1/process
SERVER_HOST=127.0.0.1
SERVER_PORT=8080

Production

# .env - Production configuration
SEARXNG_URL=https://searx.example.com/search
PROCESSOR_URL=http://processor-internal:8081/v1/process
SERVER_HOST=0.0.0.0
SERVER_PORT=8080

Content Processing Configuration

The content processor receives these default settings:

Setting Default Value Description
chunking_size 100 Number of words per chunk
chunking_type words How to split content
embedding_model AllMiniLML6V2 Model for generating embeddings

Processor Configuration

These settings are sent to the content processor service. The processor is responsible for implementing the actual chunking and embedding logic.

Vector Index Configuration

The USearch vector index is configured with:

Parameter Value
Dimensions 384
Metric Inner Product (IP)
Quantization F32
Connectivity 16
Expansion Add 128
Expansion Search 64

Setting Up SearxNG

Polymathy requires a SearxNG instance for meta-search functionality. Options include:

  1. Self-hosted: Deploy your own SearxNG instance
  2. Public instances: Use a public SearxNG instance

Public Instances

Public instances may have rate limits or restrictions. For production use, consider self-hosting.

Minimal SearxNG Configuration

If self-hosting, ensure your settings.yml includes:

search:
  formats:
    - json

Logging

Polymathy uses env_logger. Control log levels with the RUST_LOG environment variable:

# Enable debug logging
RUST_LOG=debug cargo run

# Only show warnings and errors
RUST_LOG=warn cargo run

# Module-specific logging
RUST_LOG=polymathy=debug,actix_web=info cargo run