Skip to content

[bot] No instrumentation support for swiftide agentic AI pipeline framework #59

@braintrust-bot

Description

@braintrust-bot

Summary

The Braintrust Rust SDK has no instrumentation support for swiftide, a Rust-native framework for streaming indexing, RAG query execution, and autonomous agent workflows. Swiftide provides explicit LLM chat completions, embedding generation, and agent execution API surfaces. No other Braintrust SDK instruments this library, as it is Rust-specific. Braintrust documents equivalent frameworks in other languages (LlamaIndex, LangChain, CrewAI) as supported integrations.

What is missing

Swiftide exposes three execution-oriented pipeline types, each making direct LLM or embedding calls:

1. Chat completions module

The swiftide::chat_completion module provides traits and types for LLM interactions. Each supported backend (OpenAI, Anthropic, Gemini, Groq, etc.) implements these traits. LLM calls made through swiftide's chat completion layer are not wrapped with Braintrust spans, so inputs, outputs, token usage, and latency are not captured.

2. Indexing pipeline (embedding execution)

Swiftide's indexing pipeline (swiftide::indexing) processes documents via async streaming steps including embedding generation:

indexing::Pipeline::from_loader(FileLoader::new(".").with_extensions(&["rs"]))
    .then_chunk(ChunkCode::try_for_language("rust")?)
    .then(OpenAIEmbed::default())  // ← embedding call not traced
    .then_store_with(Qdrant::default())
    .run()
    .await?;

Embedding calls within then() or then_in_batch() steps produce Embedding/Embeddings values that are never captured as Braintrust spans.

3. Query pipeline (RAG generation)

The query pipeline (swiftide::query) executes semantic retrieval and LLM response generation:

query::Pipeline::default()
    .then_transform_query(GenerateSubquestions::from_client(openai.clone()))
    .then_retrieve(SimilaritySearch::default())
    .then_answer(Simple::from_client(openai.clone()))  // ← LLM call not traced
    .query("What is swiftide?")
    .await?;

LLM calls in then_answer() and query transformation steps are not captured as spans.

4. Agent framework

The swiftide-agents crate provides an autonomous agent framework with tool integration and lifecycle hooks:

AgentBuilder::new()
    .llm(&openai)           // ← repeated LLM calls not traced
    .tools(vec![my_tool])
    .build()?
    .run()
    .await?;

Agent execution involves repeated LLM calls with tool invocations. Neither the individual LLM calls nor the overall agent run is captured as a Braintrust span.

Library significance

  • 702 GitHub stars, actively maintained
  • v0.32.1 (latest; sub-crates: swiftide-core, swiftide-agents, swiftide-integrations)
  • Rust-native streaming pipeline for RAG, document indexing, and agent execution
  • Supported LLM providers: OpenAI, Azure OpenAI, Anthropic, Gemini, OpenRouter, AWS Bedrock (Converse API), Groq, Ollama
  • Supported vector stores: Qdrant, Redis, LanceDB, PostgreSQL, DuckDB
  • Used in production by bosun-ai/kwaak (AI agent for tech debt)
  • Official docs: https://docs.rs/swiftide

Braintrust docs status

supported (in other languages, equivalent frameworks) — Braintrust documents instrumentation for frameworks that serve the same purpose as swiftide in other languages:

  • LlamaIndex (Python/TypeScript) — RAG indexing and query pipelines; swiftide is the closest Rust equivalent
  • LangChain (Python, TypeScript, Go, Java) — covered in Rust SDK issue [bot] Add instrumentation support for langchain-rust LLM framework #46; swiftide's pipeline/agent model is architecturally distinct from langchain-rust's chain abstraction
  • CrewAI, LangGraph, Pydantic AI (Python) — agent execution frameworks; swiftide's agent framework provides comparable agent-run and tool-calling surfaces

Braintrust does not list swiftide in its integrations directory or trace LLM calls page.

Upstream sources

Local files inspected

  • src/extractors.rs — only extract_openai_usage() and extract_anthropic_usage(); no swiftide-specific extractor; swiftide delegates to its provider backends (OpenAI, Anthropic, etc.) internally
  • src/stream.rswrap_stream_with_span() is a generic stream helper but is not wired to swiftide pipeline steps; swiftide's async pipeline does not yield Result<Value, E> streams compatible with the current wrapper signature
  • src/lib.rs — public API exports; no swiftide references
  • Cargo.toml — no swiftide dependency
  • Full codebase grep for swiftide, IndexingPipeline, QueryPipeline, AgentBuilder — zero results

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions