Skip to content

Quick Start

Get Polymathy running and make your first search request.

1. Configure Environment

Create a .env file in the project root:

# Required: SearxNG search endpoint
SEARXNG_URL=http://your-searxng-instance/search

# Required: Content processor service
PROCESSOR_URL=http://your-processor-service/v1/process

# Optional: Server configuration
SERVER_HOST=127.0.0.1
SERVER_PORT=8080

Using sample.env

You can copy sample.env as a starting point:

cp sample.env .env

2. Start the Service

Run Polymathy:

# Development mode
cargo run

# Production mode
cargo run --release

You should see output like:

[INFO] Starting Polymathy server on 127.0.0.1:8080

3. Make Your First Query

Using curl:

curl "http://localhost:8080/v1/search?q=rust+programming"

Example response:

{
  "0": ["https://example.com/rust-intro", "Rust is a systems programming language..."],
  "1": ["https://example.com/rust-tutorial", "Getting started with Rust requires..."],
  "2": ["https://another-site.com/rust", "The Rust programming language focuses on..."]
}

4. Explore the API Documentation

Polymathy includes multiple API documentation UIs:

UI URL
Swagger UI http://localhost:8080/swagger
ReDoc http://localhost:8080/redoc
RapiDoc http://localhost:8080/rapidoc
Scalar http://localhost:8080/scalar
OpenAPI JSON http://localhost:8080/openapi.json

Understanding the Response

The search endpoint returns a map where:

  • Keys are sequential chunk IDs (0, 1, 2, ...)
  • Values are tuples of [source_url, content_chunk]

Each content chunk is a semantic segment of the original page, typically around 100 words.

Next Steps