# Feature flags

> Every Cargo feature flag of the swiftide crate, what each one turns on, and which ones the all bundle leaves out.

By the end of this page you know which feature flags to pass to `cargo add` for your project. Each integration, and everything beyond the indexing pipeline and the query pipeline, sits behind a feature flag of the `swiftide` crate. You name the ones you need:

```sh
cargo add swiftide@0.34 --features openai,qdrant
```

## Defaults

Only the `macros` flag is on by default. It provides the `#[tool]` attribute, the `Tool` derive and the `#[indexing_transformer]` attribute. With `default-features = false` these macros are gone, so add `macros` back if you use them:

```sh
cargo add swiftide@0.34 --no-default-features --features macros,openai
```

On docs.rs, each item that needs a flag shows an "Available on crate feature ... only" badge.

The core, indexing, query and integrations crates are always compiled. The integrations crate still compiles no provider or store until you turn on its flag. Without `qdrant`, for example, `swiftide::integrations::qdrant` does not exist.

## The all bundle

The `all` flag turns on exactly these ten flags: `qdrant`, `redis`, `tree-sitter`, `openai`, `fastembed`, `scraping`, `aws-bedrock`, `groq`, `ollama` and `pgvector`.

It leaves out everything else:

- agents and tasks: `swiftide-agents`, `swiftide-tasks`, `mcp`, and `agents-contrib` with its four sub-flags
- the `anthropic` (Anthropic client), `gemini`, `dashscope` and `open-router` providers
- the `lancedb` and `duckdb` storage backends, the `redb` node cache, and the `parquet`, `kafka` and `fluvio` loaders
- `langfuse`, `metrics`, `json-schema`, `tiktoken`, `test-utils` and `tree-sitter-perl`

To build an agent, add `swiftide-agents` next to `all`.

`all` also pulls in heavy native dependencies. `fastembed` downloads ONNX (Open Neural Network Exchange) runtime binaries at build time, and `aws-bedrock` compiles the AWS (Amazon Web Services) SDK (software development kit). Name the flags you use instead, so builds stay short.

## Flag relationships

### Agents, tasks and tool protocols

- `swiftide-tasks` adds `swiftide::tasks`, the typed task graphs.
- `swiftide-agents` adds `swiftide::agents` and turns on `swiftide-tasks`.
- `mcp` adds Model Context Protocol (MCP) tool support and turns on `swiftide-agents`.
- `langfuse` adds `swiftide::langfuse` for tracing and also turns on `swiftide-agents`.
- `json-schema` adds `JsonSchema` derives to core and agent types, and also turns on `swiftide-agents`.
- `agents-contrib` adds `swiftide::agents_contrib` and turns on `swiftide-agents`. On its own it enables no capability.
- `agents-contrib-context`, `agents-contrib-planning`, `agents-contrib-file-tools` and `agents-contrib-lazy-executor` each turn on `agents-contrib` plus one capability: hooks that summarize tool output and compress the conversation, a plan tool, file tools, or a lazy tool executor.

A contrib flag never registers a tool or changes an agent by itself. You still add the tool or hook to your agent.

### OpenAI-compatible providers

The `groq`, `gemini`, `ollama`, `open-router` and `dashscope` clients build on the OpenAI client. Each of these flags also compiles `swiftide::integrations::openai`.

## TLS

Integrations that make HTTP (Hypertext Transfer Protocol) calls use rustls for TLS (Transport Layer Security) and need no setup, whatever flags you pick. Each HTTP client uses the process-wide rustls crypto provider if your application installed one, and otherwise its own: aws-lc-rs, or ring for `anthropic`. `anthropic` uses rustls even when another crate turns on native TLS.

Redis over `rediss://` is the exception. The Redis client needs a process-wide provider, so before it connects Swiftide installs aws-lc-rs if your application has not installed one. To use a different provider, install it before the first Redis call.

In the 0.34 release the clients have no provider of their own; see [Crypto provider panic](/reference/troubleshooting-and-faq/#crypto-provider-panic).

## Flag tables

The "Also enables" column lists only flags of the `swiftide` crate. A flag that turns on a dependency's feature, such as `json-schema` or `langfuse` turning on `swiftide-agents`, shows an empty cell.

### General

| Flag      | Description                        | Also enables                                                                                                     |
| --------- | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `default` | By default only macros are enabled | `macros`                                                                                                         |
| `macros`  | Undocumented                       |                                                                                                                  |
| `all`     | Undocumented                       | `qdrant`, `redis`, `tree-sitter`, `openai`, `fastembed`, `scraping`, `aws-bedrock`, `groq`, `ollama`, `pgvector` |

### Integrations

| Flag               | Description                                                        | Also enables  |
| ------------------ | ------------------------------------------------------------------ | ------------- |
| `qdrant`           | Enables Qdrant for storage and retrieval                           |               |
| `pgvector`         | Enables PgVector for storage and retrieval                         |               |
| `redis`            | Enables Redis as an indexing cache and storage                     |               |
| `tree-sitter`      | Tree-sitter for various code transformers                          |               |
| `tree-sitter-perl` | Adds Perl to the tree-sitter languages                             | `tree-sitter` |
| `openai`           | OpenAI                                                             |               |
| `groq`             | Groq                                                               |               |
| `gemini`           | Google Gemini                                                      |               |
| `dashscope`        | Dashscope prompting                                                |               |
| `open-router`      | OpenRouter prompting                                               |               |
| `ollama`           | Ollama prompting                                                   |               |
| `anthropic`        | Undocumented                                                       |               |
| `fastembed`        | FastEmbed (by qdrant) for fast, local, sparse and dense embeddings |               |
| `scraping`         | Scraping via spider as loader and a html to markdown transformer   |               |
| `aws-bedrock`      | AWS Bedrock for prompting                                          |               |
| `lancedb`          | Lancdb for persistance and querying                                |               |
| `fluvio`           | Fluvio loader                                                      |               |
| `kafka`            | Kafka loader                                                       |               |
| `parquet`          | Parquet loader                                                     |               |
| `redb`             | Redb embeddable nodecache                                          |               |
| `duckdb`           | Duckdb; sqlite fork, support Persist, Retrieve and NodeCache       |               |

### Other

| Flag          | Description                                       | Also enables      |
| ------------- | ------------------------------------------------- | ----------------- |
| `mcp`         | MCP tool support for agents (tools only)          | `swiftide-agents` |
| `metrics`     | Metrics for usage, pipeline and agent performance |                   |
| `test-utils`  | Various mocking and testing utilities             |                   |
| `json-schema` | Json schema for various types                     |                   |
| `tiktoken`    | Estimate token counts using tiktoken              |                   |

### Agent and task orchestration

| Flag                           | Description                                                                  | Also enables      |
| ------------------------------ | ---------------------------------------------------------------------------- | ----------------- |
| `swiftide-tasks`               | Typed task graphs                                                            |                   |
| `swiftide-agents`              | GenAI agents and tools                                                       | `swiftide-tasks`  |
| `agents-contrib`               | Optional agent tools, hooks, and executor helpers (no capabilities enabled). | `swiftide-agents` |
| `agents-contrib-context`       | Tool output summarization and conversation compression hooks.                | `agents-contrib`  |
| `agents-contrib-planning`      | A shared in-memory plan tool.                                                | `agents-contrib`  |
| `agents-contrib-file-tools`    | File reading with line ranges, exact replacement, and file-oriented patches. | `agents-contrib`  |
| `agents-contrib-lazy-executor` | Lazy initialization of caller-provided executors.                            | `agents-contrib`  |
| `langfuse`                     | Langfuse tracing and observability                                           |                   |

## Reference

- [`swiftide` crate root, Cargo Features section](https://docs.rs/swiftide/0.34/swiftide/index.html#cargo-features)
- [`swiftide::agents`](https://docs.rs/swiftide/0.34/swiftide/agents/index.html)
- [`swiftide::tasks`](https://docs.rs/swiftide/0.34/swiftide/tasks/index.html)
- [`swiftide::integrations`](https://docs.rs/swiftide/0.34/swiftide/integrations/index.html)
- [`swiftide::langfuse`](https://docs.rs/swiftide/0.34/swiftide/langfuse/index.html)
- [`swiftide::agents_contrib`](https://docs.rs/swiftide/0.34/swiftide/agents_contrib/index.html)

Next: [Crates](/reference/crates/)