Configuration

Complete guide to configuring Almanac for local development with Docker containers.

Environment Variables

All configuration is done through environment variables in packages/server/.env.

Quick Setup

cd packages/server
cp .env.example .env
# Edit .env with your settings

Local Development with Docker

Almanac uses Docker Compose to run all required services locally. No production/cloud services needed!

Starting Services

# Start only databases (MongoDB, Redis, Qdrant, Memgraph)
docker compose up -d

# Start everything including server and client
docker compose --profile app up -d

Local Services

The following services run in Docker containers:

  • MongoDB (port 27017): Document database

  • Redis (port 6379): Cache and session storage

  • Qdrant (port 6333): Vector database for embeddings

  • Memgraph (port 7687): Graph database for entities and relationships

  • Server (port 3000): API server (when using --profile app)

  • Client (port 5173): Web UI (when using --profile app)

All data is persisted in .data/ directory in the project root.

LLM Configuration

Almanac requires LLM models for three purposes:

  1. Chat Model: Query understanding, entity extraction, relationship extraction

  2. Embedding Model: Vector embeddings for semantic search

  3. Reranking Model (Optional): Improve search result relevance

OpenRouter Configuration

OpenRouter provides access to many open-source models with a simple API. Get your API key from: https://openrouter.ai/

Why These Models?

  • Chat: fireworks/models/gpt-oss-120b - High quality reasoning for complex queries

  • Extraction: xai/grok-4-1-fast-reasoning - Fast and accurate entity/relationship extraction

  • Embedding: openai/Qwen/Qwen3-Embedding-4B - Balanced quality and performance for semantic search

  • Reranker: deepinfra/Qwen/Qwen3-Reranker-4B - Improved search result relevance

Database Configuration

All databases run in local Docker containers. Default configuration works out of the box!

MongoDB

Docker Service: mongodb (mongo:8.2.2) Data Location: .data/mongodb/

Redis

Docker Service: redis (redis:alpine3.22) Data Location: .data/redis/

Qdrant (Vector Database)

Docker Service: qdrant (qdrant/qdrant:v1.16.0) Data Location: .data/qdrant/ Admin UI: http://localhost:6333/dashboard

Vector Sizes by Model:

  • text-embedding-3-large: 3072

  • text-embedding-3-small: 1536

  • qwen/qwen3-embedding-8b: 1024

  • qwen/qwen3-embedding-4b: 1024

  • nomic-embed-text: 768

Memgraph (Graph Database)

Docker Service: memgraph (memgraph/memgraph:3.7.0) Data Location: .data/memgraph/

Logging Configuration

Performance Configuration

Concurrency

Control parallel operations for better performance:

Adjust based on your system resources:

  • High-end systems: 32-64

  • Mid-range systems: 16-32

  • Low-end systems: 8-16

Security

Encryption

Required for storing sensitive data (OAuth tokens, API keys):

Indexing Configuration

Entity Extraction

Toxic Document Filter

Filters out documents that look like lists, bibliographies, or indexes:

Detection heuristics: >50 entities, <5 relationships, <20 char avg entity names

Data Source Sync Configuration

Sync Schedule

Almanac uses hybrid scheduling for automatic syncs:

  1. On startup: Syncs data sources that missed their last scheduled sync

  2. While running: Syncs all enabled data sources according to cron schedule

Cron Schedule Examples:

  • 0 * * * * - Every hour

  • 0 0 * * * - Every day at midnight (DEFAULT)

  • 0 */6 * * * - Every 6 hours

  • 0 0 * * 0 - Every Sunday at midnight

Note: Times are interpreted in your local server timezone.

OAuth Configuration (Optional)

For data sources requiring OAuth (Slack, GitHub, Notion), you'll need to:

  1. Create OAuth apps in each service

  2. Add credentials to .env

  3. Configure redirect URIs to point to your local server

These are only needed if you want to connect these specific data sources.

Complete Example

Here's a complete .env file for local development using OpenRouter:

Docker Management

Viewing Logs

Stopping Services

Accessing Services

Troubleshooting

Services Won't Start

Database Connection Failed

Fix: Ensure Docker containers are running:

Out of Memory

Fix: Reduce concurrency settings:

Qdrant Collection Issues

If you need to delete and recreate collections:

Next Steps

Last updated

Was this helpful?