# Repository Briefing: jaikydota/BullFlow
> Source: https://repoforai.com/repo/jaikydota/BullFlow (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/jaikydota/BullFlow
- **Category**: Agents & Frameworks (智能体与框架)
- **Primary Language**: TypeScript
- **License**: MIT
- **Engineering Health**: B+ (65/100 · Maintenance 26/35 · Adoption 13/25 · Releases 6/20 · License 20/20)
- **Review Snapshot**: 2026-12-03
- **Deployment / Stack Signals**: Docker, Self-Hosted, GPU, API
- **Momentum**: 820 ★ total (+1 24h / +109 7d) · 49 forks
- **Topics**: `ai-agents`, `bge-m3`, `content-generation`, `elasticsearch`, `knowledge-base`, `langgraph`, `milvus`, `multi-tenant`, `rag`, `social-media-marketing`
- **When to Use**: Best for: Brand teams and agencies that need to create source-backed content from company assets, publish across supported domestic and overseas channels, and manage multiple clients in one system. Skip if: You only need document Q&A or scheduling, cannot operate the search and storage stack, or require fully offline publishing without third-party connectors.

## Overview
```text
### Architecture & Core Mechanics
BullFlow is an end-user application with separate React 19/TypeScript interfaces for users, operators, and the publishing gateway. Its Python 3.12 FastAPI backend uses SQLAlchemy 2 async and Alembic for relational persistence and migrations. A LangGraph ReAct agent streams responses over SSE and invokes tools for knowledge search, media generation, and export. Generation jobs run asynchronously, and APScheduler handles scheduled work.

MySQL stores source chunks, Milvus indexes BGE-M3 vectors, Elasticsearch 8 with IK indexes full text, Redis supports caching and rate limiting, and MinIO stores objects. At retrieval time, vector and keyword queries fan out in parallel. Results are fused with RRF by default or normalized weights, can be reranked with BGE-Reranker, and can be expanded with adjacent chunks. The separately deployable `tlf_backend` handles publishing and sends signed status and metrics webhooks back to the main app.

### Key Capabilities & Differentiators
Retrieval can use five structured record types—company, brand, product, customer, and case study—alongside uploaded documents. Ingestion falls back from PaddleOCR to Pandoc and native parsers, then to storage without indexing when text cannot be extracted. wtpsplit provides sentence boundaries for chunking while preserving tables and code blocks. OpenCLIP adds text-to-image search, WhisperX can feed audio transcripts into document retrieval, and Ragas evaluation can tune hybrid-search weights. Source previews let reviewers inspect the retrieved passages behind a response.

The creation workflow produces illustrated articles, 1–9 images per batch, and short videos, with PDF and Word export for articles. Generation and distribution can be scheduled. The gateway exposes 17 listed destinations across 11 domestic and six overseas platforms, returns publication status by webhook, and collects daily account metrics. Role controls, tenant-scoped retrieval, usage credits, subscriptions, and invoicing support multi-client operations.

### Trade-offs & Limitations
A standalone RAG app is a better operational fit when the requirement stops at internal Q&A; a dedicated social scheduler is simpler when drafts already arrive from an editorial system. BullFlow ties source assets and draft generation to publishing and billing, but operators take on more stateful services and have to keep MySQL, Milvus, and Elasticsearch aligned as content and tenant data change. Test tenant isolation across retrieval paths and verify approval controls before enabling scheduled publishing.

Local ingestion and retrieval avoid per-call model API fees, not hardware or operating costs. OpenAI-compatible generation endpoints can be self-hosted, but compatibility with the media workflows should be tested rather than assumed. If a remote generator receives retrieved excerpts or media, those inputs leave the deployment. Social publishing separately depends on Lingjing or Composio, so the open-source gateway is not a way to eliminate provider fees, platform restrictions, or external data transfers.

### Hardware & Deployment Guide
For a source deployment, plan for Python 3.12, Node.js 20+, Pandoc, and FFmpeg/FFprobe; PDF export additionally needs the WeasyPrint system libraries and suitable fonts. The root includes `docker-compose.yml` and `docker-compose.milvus.yml`. In the main Compose file, the backend loads `backend/.env`, runs `alembic upgrade head`, and only then starts `uvicorn app.main:app` with one worker on port 8021. The Elasticsearch IK plugin must match the Elasticsearch version exactly.

The recommended starting point is at least 16 GB of system RAM, plus several gigabytes for model files and separate data capacity for the storage services. Images can bundle retrieval models at build time. Embeddings can fall back to CPU and OCR benefits from a GPU, but the supplied Compose backend explicitly requests NVIDIA devices, so review that stanza for CPU-only hosts. Test sizing with your corpus, reranker settings, and concurrency. No GitHub release is listed; pin and validate the commit and image versions you intend to deploy.
```

## Key Capabilities
```text
- Retrieval: Milvus vector search and Elasticsearch IK full-text search run in parallel, with RRF by default and optional BGE reranking.
- Ingestion: PaddleOCR, Pandoc, and native parsers extract text from 12 listed formats; semantic chunking preserves tables and code blocks.
- Source inspection: Agent responses expose retrieved snippets, source documents, relevance scores, and previews for editorial verification.
- Creation: LangGraph tool calls support illustrated articles, batches of 1–9 images, short video, and PDF or Word export.
- Publishing: A separately deployable SDK and webhook gateway covers 17 listed platforms through Lingjing and Composio.
- Operations: Tenant-scoped retrieval, role permissions, usage credits, subscriptions, invoices, and audit logs are part of the application.
```

## Quick Start / Clone
```bash
cd backend
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
alembic upgrade head
python -m scripts.seed_skills                     # 导入 56 个内置创作技能（只需执行一次，可重复执行）
uvicorn app.main:app --host 0.0.0.0 --port 8020 --reload --reload-dir app
```
