Configuration

This server can be configured using environment variables. This allows you to adjust performance parameters like concurrency, timeouts, and retry logic without modifying the source code.

To set these variables, you can create a .env file in the root of the project, or set them directly in your shell or deployment environment.

Environment Variables

Variable Default Description
DEEPWIKI_MAX_CONCURRENCY 5 The maximum number of concurrent requests the crawler will make.
DEEPWIKI_REQUEST_TIMEOUT 30000 The timeout for each HTTP request in milliseconds (ms).
DEEPWIKI_MAX_RETRIES 3 The maximum number of times the crawler will retry a failed request.
DEEPWIKI_RETRY_DELAY 250 The base delay in milliseconds (ms) for the exponential backoff retry mechanism.
GITHUB_TOKEN - An optional GitHub Personal Access Token to increase API rate limits for repository resolution.

Example .env file

Create a file named .env in the project's root directory to customize the configuration:

# Increase concurrency for faster crawling on a strong connection
DEEPWIKI_MAX_CONCURRENCY=10

# Increase timeout for slow-loading documentation sites
DEEPWIKI_REQUEST_TIMEOUT=60000

# Be more persistent with retries
DEEPWIKI_MAX_RETRIES=5
DEEPWIKI_RETRY_DELAY=500

# Provide a GitHub token to avoid rate limits when resolving library names
GITHUB_TOKEN=ghp_YourGitHubTokenHere

When running in Docker, you can pass these variables using the -e flag. See the Deployment guide for examples.