Glossary
You get a short definition of each core term in the Swiftide docs, grouped by section and linked to the page that explains it.
Agents
Section titled “Agents”- Agent: a loop around a large language model (LLM). Each turn, it sends the message history to the model and runs the tool calls it returns. Build one with
Agent::builder(). - Tool: a function the model can call by name with JSON arguments. It implements the
Tooltrait. The#[tool]macro and theToolderive write it for you. - Hook: a closure the agent runs at a fixed point in its loop, such as
before_all,before_tool,after_eachoron_stop. Most hooks receive&mut Agent. - Tool executor: where tools run commands and read or write files. It implements
ToolExecutor. The default,LocalExecutor, runs commands on your machine. - Context: the state an agent runs in. It implements
AgentContextand holds the message history and the tool executor. The default isDefaultContext. - Message history: the storage that keeps a context’s chat messages. It implements
MessageHistory. The default keeps messages in memory.Redisfrom theredisintegration keeps them between runs. - Stop reason: why an agent stopped, for example because a tool asked it to or it failed. Read it with
stop_reason(). Its type isStopReason.
- Task: a graph of typed steps with one input and one output type. Running a
Taskreturns aTaskRunOutcome: the output, or paused. - Task node: one typed step in a task, with an input, an output and an error type. It implements
TaskNode.Task::register_node_fnturns a closure into a node. - Transition: the value that says where a task goes after a node. Register it on that node with
Task::register_transitionand a function from the node’s output to aTransition. In that function,next.transitions_with(value)moves to nodenext. Passtask.transitions_to_finish()as the function to end the task. - Fan-out: a transition that starts several branches at once.
Transition::fan_outstarts it,andadds a branch, andjoin_with(join.join())names the join that waits for every branch. Until then it is aFanOutTransition, which cannot run. - Join: a node that receives the outputs of every fan-out branch together as a
JoinInput.NodeId::joingives the join target. Each branch registers its own transition to that target.
Indexing
Section titled “Indexing”- Indexing pipeline: a stream that loads data as nodes, transforms them and stores them. Start one with
Pipeline::from_loaderfromswiftide::indexingand run it withrun. - Node: one unit of data in an indexing pipeline: a path, a chunk, metadata and embeddings.
Nodeis generic over its chunk type.TextNodeis a node whose chunk is aString. - Chunk: the content a node carries, in its
chunkfield. Any type that isClone,Send,Sync,Debug,'staticand readable as bytes implements theChunktrait automatically. - Loader: the source at the start of an indexing pipeline. It implements
Loaderand turns files, pages or messages into nodes.FileLoaderreads files from disk. - Transformer: a step that maps one node to one node, for example to add metadata. It implements
Transformer. Add it withthen. - Batch transformer: a step that takes many nodes in one call. It implements
BatchableTransformer. Add it withthen_in_batch. - Chunker: a step that splits one node into many. It implements
ChunkerTransformer, andChunkMarkdownis one. Add it withthen_chunk. - Embedder: a model that turns text into vectors. Dense models implement
EmbeddingModelandEmbedcalls them. Sparse models implementSparseEmbeddingModelandSparseEmbedcalls them. - Persist: the trait a pipeline calls to store nodes. Add a storage with
then_store_with. - Storage: the backend that implements
Persist, such as Qdrant, PgVector, Redis or LanceDB. Their flags areqdrant,pgvector,redisandlancedb. - Node cache: a record of the nodes a pipeline already processed. It implements
NodeCache.filter_cacheddrops nodes found in the cache. A node enters it only after passing the whole pipeline.
Querying
Section titled “Querying”- Query pipeline: a pipeline that turns a question into an answer in four stages: query transformers (
then_transform_query), a retriever (then_retrieve), response transformers (then_transform_response) and an answer generator (then_answer). Start one withPipeline::from_search_strategyfromswiftide::queryand ask withquery. - Retriever: a store that fetches documents with a search strategy. It implements
Retrievefor that strategy. Qdrant, PgVector, LanceDB (lancedbflag) and DuckDB (duckdbflag) are retrievers. - Search strategy: settings for how a retriever searches, such as result count and filter. It implements
SearchStrategy. Built-in ones areSimilaritySingleEmbedding,HybridSearchandCustomStrategy. - Response transformer: a step between retrieval and the answer. It implements
TransformResponse.Summaryreplaces the response with a summary of the documents. The FastEmbedRerank(fastembedflag) reorders the documents. - Answer generator: the last step, which writes the answer from the documents. It implements
Answer.Simplefromswiftide::query::answersasks an LLM. - Evaluator: a component that sees the retrieved documents and the final answer of each query. It implements
EvaluateQuery. Add it withevaluate_with.Ragasexports a dataset for the Ragas framework.
- Feature flag: a Cargo feature of
swiftidethat compiles in an optional part. Onlymacrosis on by default. Agents needswiftide-agents, tasks needswiftide-tasks, and each integration needs its own flag. - Integration: a module under
swiftide::integrationsthat wraps an outside library or service. Examples are providers (openai), stores (qdrant), loaders (scraping) and parsers (treesitter). Each has its own feature flag.
Reference
Section titled “Reference”swiftide(crate root, with the list of Cargo features)Agent,Hook,DefaultContext,StopReason,LocalExecutorTool,ToolExecutor,AgentContext,MessageHistoryTask,TaskRunOutcome,TaskNode,Transition,FanOutTransition,NodeId,JoinInputindexing::Pipeline,Node,TextNode,Chunk,Loader,Transformer,BatchableTransformer,ChunkerTransformer,ChunkMarkdown,EmbeddingModel,SparseEmbeddingModel,Embed,SparseEmbed,Persist,NodeCachequery::Pipeline,Retrieve,SearchStrategy,SimilaritySingleEmbedding,HybridSearch,CustomStrategy,TransformResponse,Summary,Answer,Simple,EvaluateQuery,Ragasswiftide::integrations