Swiftide is a Rust framework for LLM applications, made of three layers that share the same core primitives: an agent harness, typed task graphs for orchestration, and streaming indexing and query pipelines for retrieval-augmented generation (RAG). Integrations are feature-gated, so a build pulls in only the ones it declares.
The agent harness owns message history and runs the loop of model calls, tool invocations, lifecycle hooks, and stop conditions. Tools come from Rust functions annotated with #[swiftide::tool], derived tools, manual Tool implementations, or MCP toolboxes loaded at runtime. An AgentContext abstracts the message history — in memory by default — and gives tools access to the outside world through a ToolExecutor, local by default with a separate Docker executor available. Agents support human-in-the-loop approval through ApprovalRequired, structured stop and failure payloads with custom JSON schemas, and streaming responses with reasoning-item handling.
Tasks are the orchestration layer: a typed graph of TaskNode steps, each with an input, output, and error type, connected by transitions that decide where an output goes next. Graphs are typed at build time and can compose agents, other Swiftide components, and plain functions. They support closure nodes for glue steps, static fan-out with explicit joins, sequential or parallel branches, and pause, resume, and reset.
Indexing pipelines stream data through loaders, caches, chunkers, transformers, batch transformers, embedders, and storage backends; query pipelines cover query transformation, retrieval, response transformation, answer generation, hybrid search, reranking patterns, and evaluation. Execution across agents, tasks, and pipelines can be traced with tracing, metrics, and Langfuse.
| Area | Supported integrations |
|---|---|
| LLM providers | OpenAI and Azure OpenAI, Anthropic, Gemini, OpenRouter, AWS Bedrock Converse API, Groq, Ollama, Dashscope |
| Tooling | MCP toolboxes, local command execution, custom tool executors |
| Storage and retrieval | Qdrant, Redis, LanceDB, PgVector, DuckDB, Redb |
| Loading data | Files, scraping, Fluvio, Kafka, Parquet, executor-backed file streams |
| Code and text processing | Markdown, text splitting, tree-sitter code chunking and metadata |
| Observability | tracing, metrics, Langfuse |
The project is pre-1.0, and the agent-harness and task-graph APIs can still change.
Features
- Agent harness: message history, model calls, tool loops, lifecycle hooks before and after completions, tools, messages, chunks, start, and stop, plus configurable stop conditions
- Tools: attribute-macro functions, derived tools, manual Tool implementations, and MCP toolboxes loaded at runtime
- Tool executors: local command and file access by default, with custom or Docker-backed executors
- Human in the loop: ApprovalRequired tools and feedback-aware contexts, with pause and resume for agents and tasks
- Typed task graphs: TaskNode steps with input, output, and error types, typed NodeId handles, transitions, and join payloads
- Fan-out and join: static branching with explicit joins, run sequentially or in parallel
- Streaming RAG pipelines: loaders, caches, chunkers, transformers, embedders, and storage backends composed into one stream
- Query pipelines: query transformation, retrieval, response transformation, answer generation, hybrid search, reranking, and evaluation
- Structured outputs: custom JSON schemas for stop and failure payloads
- Observability: tracing spans, metrics, and Langfuse for agents, tasks, and pipelines
Integrates with
LanceDB
Developer-friendly open-source embedded/serverless vector database for multimodal AI, built on the Lance columnar format for billion-scale retrieval.
Langfuse
Open-source platform for tracing, evaluating, and debugging LLM applications, self-hosted or cloud
-
Ollama
Runs open large language models locally without an API key
Qdrant
Open-source vector database and similarity-search engine with filtering, hybrid search and a managed cloud.
