Skip to content

RAG + MCP Pipeline

Combine retrieval-augmented generation with MCP tools in one orchestrated workflow.

When to use

  • Internal knowledge bases + live tool calls (filesystem, APIs)
  • Studio visual workflows with document ingestion

Components

Layer HiveFlow module
Chunk & embed hiveflow.rag
Tool calls hiveflow.mcp
Orchestration HiveFlow + DAGOrchestrator

Examples

Minimal RAG

from hiveflow import RAGPipeline, MemoryVectorStore, DummyEmbeddingModel

store = MemoryVectorStore()
pipeline = RAGPipeline(vector_store=store, embedding_model=DummyEmbeddingModel())
await pipeline.ingest_text("doc-1", "HiveFlow supports HITL and MCP.")
results = await pipeline.query("What supports MCP?")

Add MCP tools

from hiveflow import MCPPluginManager

mgr = MCPPluginManager()
await mgr.register_plugin(
    plugin_id="filesystem",
    name="Filesystem",
    transport="stdio",
    command="npx",
    args=["-y", "@modelcontextprotocol/server-filesystem", "/tmp"],
)