FlowFoundry: a strategy-first, cloud-agnostic agentic workflow framework (LangGraph/LangChain)
Project description
FlowFoundry
A strategy-first, cloud-agnostic framework for LLM workflows.
Compose chunking, indexing, retrieval, reranking, and agentic flows — with Keras-like ergonomics over LangChain / LangGraph.
✨ Features
- Strategies: chunking, indexing, retrieval, reranking
- Functional API: call strategies directly as Python functions
- Blocks API: compose strategies like layers
- Nodes & Graphs: LangGraph-backed workflows (YAML or Python)
- Extensible: register custom strategies or nodes
Installation
Core only:
pip install flowfoundry
With extras:
pip install "flowfoundry[rag,search,rerank,qdrant,openai,llm-openai]"
Extras include: chromadb, qdrant-client, sentence-transformers, rank-bm25, openai, etc. All examples run offline by default (echo LLM). Missing deps no-op gracefully.
Sanity check:
from flowfoundry import ping, hello
print(ping()) # -> "flowfoundry: ok"
print(hello("there")) # -> "hello, there!"
Quickstart (Functional API)
from flowfoundry.functional import (
chunk_recursive, index_chroma_upsert, index_chroma_query, preselect_bm25
)
text = "FlowFoundry lets you mix strategies to build RAG."
chunks = chunk_recursive(text, size=120, overlap=20, doc_id="demo")
# Index & query (requires chromadb extra)
index_chroma_upsert(chunks, path=".ff_chroma", collection="docs")
hits = index_chroma_query("What is FlowFoundry?", path=".ff_chroma", collection="docs", k=8)
# Optional rerank (requires rank-bm25)
hits = preselect_bm25("What is FlowFoundry?", hits, top_k=5)
print(hits[0]["text"])
CLI + YAML
start: retrieve
nodes:
- id: retrieve
type: strategy.retrieve
params: { name: chroma_query, path: .ff_chroma, collection: docs, k: 8 }
- id: rerank
type: strategy.rerank
params: { name: bm25_preselect, top_k: 8 }
- id: prompt
type: prompt.rag
- id: answer
type: llm.chat
params: { provider: echo, model: gpt-4o-mini }
edges:
- { source: retrieve, target: rerank }
- { source: rerank, target: prompt }
- { source: prompt, target: answer }
Run:
flowfoundry run rag_local.yaml --state '{"query":"Hello!"}'
Functional API Reference
Available in flowfoundry.functional:
Chunking
| Function | Purpose | Extra deps |
|---|---|---|
chunk_fixed |
Fixed-size splitter | – |
chunk_recursive |
Recursive splitter | langchain-text-splitters |
chunk_hybrid |
Hybrid splitter | – |
chunk_fixed(text, *, size=800, overlap=80, doc_id="doc") -> list[Chunk]
chunk_recursive(text, *, size=800, overlap=80, doc_id="doc") -> list[Chunk]
chunk_hybrid(text, **kwargs) -> list[Chunk]
Indexing (Chroma)
| Function | Purpose | Extra deps |
|---|---|---|
index_chroma_upsert |
Upsert chunks into Chroma | chromadb |
index_chroma_query |
Query Chroma | chromadb |
index_chroma_upsert(chunks, *, path=".ff_chroma", collection="docs") -> str
index_chroma_query(query, *, k=5, path, collection) -> list[Hit]
Indexing (Qdrant)
| Function | Purpose | Extra deps |
|---|---|---|
index_qdrant_upsert |
Upsert chunks into Qdrant | qdrant-client |
index_qdrant_query |
Query Qdrant | qdrant-client |
index_qdrant_upsert(chunks, *, url, collection, dim=None) -> str
index_qdrant_query(query, *, url, collection, k=5, vector=None) -> list[Hit]
Reranking
| Function | Purpose | Extra deps |
|---|---|---|
rerank_identity |
No-op reranker | – |
preselect_bm25 |
BM25 preselect | rank-bm25 |
rerank_cross_encoder |
Cross-encoder reranker | sentence-transformers |
rerank_identity(query, hits) -> list[Hit]
preselect_bm25(query, hits, top_k=20) -> list[Hit]
rerank_cross_encoder(query, hits, *, model, top_k=None) -> list[Hit]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flowfoundry-1.0.1.tar.gz.
File metadata
- Download URL: flowfoundry-1.0.1.tar.gz
- Upload date:
- Size: 24.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7436315e0872ff4e57e2366e6e74c1db9477dae33e3cdd90c9f1511538f28d4
|
|
| MD5 |
fef9c868286f920be57c6e5fde30d798
|
|
| BLAKE2b-256 |
e117578c5da9f46ea565ab24bf81564e885b087106092ad7ff9407f70164619f
|
File details
Details for the file flowfoundry-1.0.1-py3-none-any.whl.
File metadata
- Download URL: flowfoundry-1.0.1-py3-none-any.whl
- Upload date:
- Size: 31.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b966cddfc4c45b0e70025d872314c8fde8091440738cedc4304358a968c024d
|
|
| MD5 |
7d67e12e794dc93298d726e8641c5187
|
|
| BLAKE2b-256 |
e25470d0ea1c30b6d864da2d830781772d209e14adb1915c0fabcc1c18b3f9b6
|