# bettafish | BaiFu | Knowledge Base | Instagit

微舆：人人可用的多Agent舆情分析助手，打破信息茧房，还原舆情原貌，预测未来走向，辅助决策！从0实现，不依赖任何框架。

GitHub Stars: 35.7k

Repository: https://github.com/666ghj/bettafish

---

## Articles

### [How to Troubleshoot Incomplete Outputs or Errors from BettaFish Agents](/666ghj/bettafish/how-to-troubleshoot-when-agents-produce-incomplete-or-errors-during-analysis)

Troubleshoot incomplete BettaFish agent outputs and errors by inspecting node execution LLM reliability and logs. Learn to fix crashes with targeted retries and configuration adjustments.

- Tags: how-to-guide
- Published: 2026-02-23

### [Security Measures for the BettaFish Flask Web Interface](/666ghj/bettafish/what-security-measures-are-in-place-for-the-flask-web-interface)

Discover the security measures for BettaFish Flask web interface. Learn about environment secrets, session integrity, and network access control for robust protection. Explore the 666ghj/bettafish repo.

- Tags: security-measures
- Published: 2026-02-23

### [How Sentiment Analysis Handles Chinese Text from Weibo in BettaFish](/666ghj/bettafish/how-does-sentiment-analysis-handle-chinese-text-from-weibo)

Learn how sentiment analysis processes Chinese text from Weibo using the WeiboMultilingualSentimentAnalyzer. Discover native tokenization and localized sentiment labels.

- Tags: deep-dive
- Published: 2026-02-23

### [Node-Based Processing Architecture in BettaFish: How the Four Engines Orchestrate AI Pipelines](/666ghj/bettafish/what-is-the-node-based-processing-architecture-in-each-engine)

Explore BettaFish's node-based processing architecture. Discover how four specialized engines orchestrate AI data pipelines using BaseNode and shared mutable state.

- Tags: architecture
- Published: 2026-02-23

### [How to Integrate Additional LLM Providers into BettaFish: A Complete Guide](/666ghj/bettafish/how-to-integrate-additional-llm-providers-beyond-the-default-configuration)

Integrate multiple LLM providers into BettaFish easily. Extend Pydantic settings with API keys and URLs for seamless primary or fallback model configuration. Get started now.

- Tags: how-to-guide
- Published: 2026-02-23

### [How Prompts Are Structured in the prompts/ Modules for Each bettafish Agent](/666ghj/bettafish/how-are-prompts-structured-in-the-prompts-modules-for-each-agent)

Discover how prompts are structured in the bettafish repository. Learn about JSON schemas, system prompt f-strings, and serialization for agent LLM configurations.

- Tags: internals
- Published: 2026-02-23

### [MindSpider Crawling Strategies for Social Platforms: A Technical Deep Dive](/666ghj/bettafish/what-crawling-strategies-does-mindspider-use-for-different-social-platforms)

Explore MindSpider's technical crawling strategies including search, detail, and creator modes. Learn how it uniformly crawls seven Chinese social platforms using the PlatformCrawler class.

- Tags: deep-dive
- Published: 2026-02-23

### [How BettaFish Implements Streaming Responses with Flask and SSE](/666ghj/bettafish/how-does-the-streaming-response-work-with-flask-and-sse)

Learn how BettaFish uses Flask and SSE for real-time streaming responses, pushing progress updates directly to browsers without WebSockets or polling.

- Tags: how-to-guide
- Published: 2026-02-23

### [How to Create Custom Report Templates in ReportEngine: A Complete Guide](/666ghj/bettafish/how-to-create-custom-report-templates-in-reportengine)

Learn how to create custom report templates in ReportEngine by adding Markdown files or using the custom_template parameter. Unlock powerful, personalized reporting today.

- Tags: how-to-guide
- Published: 2026-02-23

### [State Management Patterns in BettaFish Agents: 7 Core Implementation Strategies](/666ghj/bettafish/what-are-the-state-management-patterns-used-across-agents)

Discover 7 core BettaFish state management patterns for AI agents. Learn immutable containers, hierarchical composition, and explicit mutation for predictable workflows.

- Tags: deep-dive
- Published: 2026-02-23

### [How the Text Processing Pipeline Works in Bettafish Engine Modules](/666ghj/bettafish/how-does-the-text-processing-pipeline-work-in-the-engine-modules)

Explore the four-stage text processing pipeline in Bettafish engine modules. Learn how it cleans, extracts, repairs, and parses LLM outputs into structured JSON for QueryEngine, MediaEngine, and InsightEngine.

- Tags: internals
- Published: 2026-02-23

### [How to Add Custom Tools to an Agent's Toolset in Bettafish](/666ghj/bettafish/how-to-add-custom-tools-to-an-agents-toolset)

Learn to add custom tools to Bettafish agents. Wrap APIs, define response classes, add retry logic, and register your tool for enhanced agent capabilities.

- Tags: how-to-guide
- Published: 2026-02-23

### [BettaFish Data Pipeline: Complete Flow from Data Collection to Final Report Generation](/666ghj/bettafish/what-is-the-flow-from-data-collection-to-final-report-generation)

Explore the BettaFish Data Pipeline: Discover the complete flow from data collection with MindSpider to LLM-enhanced narratives from QueryEngine and final HTML reports via ReportEngine.

- Tags: how-to-guide
- Published: 2026-02-23

### [How GraphRAG Works in ReportEngine for Knowledge Graph Construction](/666ghj/bettafish/how-does-graphrag-work-in-reportengine-for-knowledge-graph-construction)

Learn how GraphRAG in ReportEngine builds knowledge graphs from JSONs, stores them, and enables LLM queries for enriched reports. Discover cross-engine insights now.

- Tags: deep-dive
- Published: 2026-02-23

### [How to Customize or Swap Sentiment Analysis Models in InsightEngine](/666ghj/bettafish/how-to-customize-or-swap-sentiment-analysis-models-in-insightengine)

Easily customize or swap sentiment analysis models in InsightEngine. Modify the model_name variable or replace the global instance for full control. Explore the bettafish repository for details.

- Tags: how-to-guide
- Published: 2026-02-23

### [How QueryAgent, MediaAgent, and InsightAgent Coordinate in BettaFish’s Deep-Search Pipeline](/666ghj/bettafish/how-do-queryagent-mediaagent-and-insightagent-coordinate-in-the-analysis-pipeline)

Discover how BettaFish coordinates QueryAgent MediaAgent and InsightAgent using a Flask orchestrator and Streamlit subprocesses. Learn about log aggregation and JSON merging in this deep search pipeline.

- Tags: internals
- Published: 2026-02-23

### [How to Deploy BettaFish Using Docker-Compose: Complete Setup Guide](/666ghj/bettafish/how-to-deploy-bettafish-using-docker-compose)

Deploy BettaFish quickly with Docker Compose. Follow our guide to set up the Flask UI and PostgreSQL database in minutes. Get started now!

- Tags: how-to-guide
- Published: 2026-02-23

### [Understanding the IR (Intermediate Representation) System in ReportEngine and Document Stitching](/666ghj/bettafish/what-is-the-ir-intermediate-representation-system-in-reportengine-and-how-does-document-stitching-work)

Explore ReportEngine's IR system, a JSON contract for chapter structure validation. Learn how Document Stitching merges chapters into cohesive documents with DocumentComposer.

- Tags: deep-dive
- Published: 2026-02-23

### [How InsightEngine Queries Private Databases Using SQLAlchemy: Async Architecture Explained](/666ghj/bettafish/how-does-insightengine-query-private-databases-using-sqlalchemy)

Discover how InsightEngine queries private databases with SQLAlchemy. Learn about its async architecture and raw SQL execution for AI agents.

- Tags: deep-dive
- Published: 2026-02-23

### [How to Configure LLM API Keys and Model Settings for Each Agent in `.env`](/666ghj/bettafish/how-to-configure-llm-api-keys-and-model-settings-for-each-agent-in-env)

Configure LLM API keys and model settings for each agent in your .env file with BettaFish. Easily manage diverse provider configurations for agents without code changes.

- Tags: how-to-guide
- Published: 2026-02-23

### [BERT vs GPT-2 vs XGBoost vs LSTM: Comparing Sentiment Analysis Models in Bettafish](/666ghj/bettafish/what-are-the-differences-between-the-sentiment-analysis-models-bert-gpt-2-xgboost-lstm)

Compare BERT GPT-2 XGBoost and LSTM sentiment analysis models in bettafish. Understand their distinct machine learning paradigms and find the best approach for your needs.

- Tags: comparison
- Published: 2026-02-23

### [How MindSpider Crawls Social Media Data from Weibo, Douyin, and Xiaohongshu](/666ghj/bettafish/how-does-mindspider-crawl-social-media-data-from-platforms-like-weibo-douyin-and-xiaohongshu)

Learn how MindSpider crawls Weibo, Douyin, and Xiaohongshu. Discover its DeepSentimentCrawling pipeline using Playwright for efficient social media data extraction and storage.

- Tags: how-to-guide
- Published: 2026-02-23

### [ReportEngine Architecture and Report Generation Pipeline: How the Bettafish Codebase Converts Agent Outputs into Structured Reports](/666ghj/bettafish/what-is-the-architecture-of-reportengine-and-how-does-it-generate-reports-from-agent-outputs)

Explore the ReportEngine architecture in bettafish. See how its four-layer LLM-driven pipeline converts agent outputs into structured HTML, Markdown, or PDF reports.

- Tags: architecture
- Published: 2026-02-23

### [How ForumEngine Coordinates Multiple Agents Through the Forum Collaboration Mechanism](/666ghj/bettafish/how-does-forumengine-coordinate-multiple-agents-through-the-forum-collaboration-mechanism)

Discover how ForumEngine coordinates multiple agents using its forum collaboration mechanism. Learn how it monitors logs, buffers contributions, and triggers LLM moderators for synthesized responses.

- Tags: how-to-guide
- Published: 2026-02-23

