BettaFish Public Opinion Research
Research public opinion across social media, the web, and private data, then produce interactive reports.
- Source repo
- 666ghj/BettaFish
- Stars
- ★ 43k
- Last updated
- 2mo ago v3.0.0
- FARS reviewed
- Nov 08, 2026
- License
- GPL-2.0
- Primary language
- Python
- FA score
- 42/100 · Major gaps
At a glance
- How it runs
- Works with
- Universal · cross-platformOpenAI API
- Cost
- Free software; you pay for model usage
- Setup effort
- High · needs real infrastructure
- You'll need
- Typical use
- A university or brand-research team needs to combine web coverage, social posts, and large comment sets into a reputation or event report.
- Not a fit if
- Teams wanting a managed analytics service without running their own database and model APIs
- Anyone needing commercial or profit-making use, which the project explicitly prohibits
- Teams unwilling to own crawler compliance duties or install a Playwright browser
- Website
- deepwiki.com/666ghj/BettaFish ↗ set on GitHub
- Maintenance
- Commits in the last 6 monthslast commit 2026-10-01latest release v3.0.0 (2025-12-23)+7.3 ★/day over 7 days
- Source review
- 42/100 · Major gaps 1 safety controls not found
What does this agent do, and when should you use it?
BettaFish is a pure-Python, from-scratch multi-agent system for public-opinion research, organized around QueryEngine, MediaEngine, InsightEngine, ForumEngine, and ReportEngine. Its Flask application accepts a natural-language research question, runs web search, multimodal analysis, and private-database analysis in parallel, and coordinates further investigation through a moderated forum loop. MindSpider can separately collect social-media topics, posts, and comments, while SentimentAnalysisModel includes multilingual, BERT, GPT-2, Qwen3, and conventional machine-learning options. ReportEngine binds the collected findings into a validated Document IR and renders an interactive HTML report, with PDF and Markdown output also supported. The system can be self-hosted with Docker Compose or a local Python environment, uses OpenAI-compatible model endpoints, and is documented primarily with PostgreSQL while allowing MySQL configuration. It is best suited to research or engineering teams prepared to operate model APIs, databases, crawlers, and compliance controls rather than buyers seeking a managed analytics service.
The end-to-end path starts when app.py receives a question through the Flask application and launches Query Agent, Media Agent, and Insight Agent concurrently. QueryEngine calls domestic and international web and news search tools; MediaEngine examines video, images, and structured search-result cards; InsightEngine uses asynchronous read-only SQLAlchemy queries, keyword_optimizer.py, and sentiment_analyzer.py to retrieve topics, comments, and sentiment signals from a private opinion database. During iterative research, ForumEngine/monitor.py watches agent messages, llm_host.py produces moderator guidance, and the agents read the discussion through utils/forum_reader.py to reflect and redirect their searches. ReportEngine then selects a Markdown template, designs the layout, assigns word budgets, generates and validates chapter JSON, binds it with stitcher.py into a Document IR, and renders interactive HTML with optional PDF and Markdown exports. MindSpider can also run independently for broad-topic extraction or deep sentiment crawling through its --broad-topic, --deep-sentiment, and --complete commands.
- A university or brand-research team needs to combine web coverage, social posts, and large comment sets into a reputation or event report.
- An analytics group with an internal feedback database wants to study private operational data alongside public discussion.
- A media researcher needs to inspect text, images, short-form video, and structured search cards rather than limiting analysis to text.
- A data-science team wants runnable implementations of multilingual, BERT, GPT-2, Qwen3, and classical machine-learning sentiment methods for Weibo-oriented experiments.
- A developer studying agent architecture wants a Python implementation that does not depend on an existing agent framework and exposes its search, forum, and reporting components.
- A report engineer already has Markdown outputs from one or more analysis engines and wants to retry synthesis or rerender HTML, PDF, or Markdown without rerunning research.
Key setup facts
Pulled from the install and usage notes below. The project README has the current values.
- Install / run
docker compose up -dpip install -r requirements.txtuv pip install -r requirements.txt
- Ports
5000- Environment variables
DB_HOSTDB_PORTDB_PASSWORDAPI_KEYBASE_URL- Config files
.env.example.env- Runtime
- Python 3.9+
- Install notes cover
- Windows · macOS · Linux · Docker
How do you install or deploy this agent?
Docker path: copy .env.example to .env, configure the database and every required model endpoint, then run docker compose up -d from the repository root and open http://localhost:5000. The documented Docker database defaults are DB_HOST=db, DB_PORT=5432, DB_USER=bettafish, DB_PASSWORD=bettafish, and DB_NAME=bettafish.
Source path: prepare Windows, Linux, or macOS with Python 3.9+, PostgreSQL or MySQL, and at least 2 GB of recommended memory. Create an environment with conda create -n your_conda_name python=3.11 followed by conda activate your_conda_name, or use uv venv --python 3.11. Install packages with pip install -r requirements.txt or uv pip install -r requirements.txt, then install the crawler browser with playwright install chromium. Copy .env.example to .env; configure DB_HOST, DB_PORT, DB_USER, DB_PASSWORD, DB_NAME, DB_CHARSET, and DB_DIALECT, plus the API_KEY, BASE_URL, and MODEL_NAME values required by Insight, Media, and the other model-backed components. Model endpoints must implement the OpenAI-compatible request format. PDF export is optional and requires separate WeasyPrint system dependencies.
How do you use this agent?
For the first full-system invocation, activate the environment, run python app.py from the repository root, visit http://localhost:5000, and submit an analysis request conversationally. Individual engines can instead be launched with streamlit run SingleEngineApp/query_engine_streamlit_app.py --server.port 8503, streamlit run SingleEngineApp/media_engine_streamlit_app.py --server.port 8502, or streamlit run SingleEngineApp/insight_engine_streamlit_app.py --server.port 8501.
For crawling, run cd MindSpider and python main.py --setup. Use python main.py --broad-topic for topic extraction, python main.py --complete --date 2024-01-20 for the complete dated flow, or python main.py --deep-sentiment --platforms xhs dy wb for platform-scoped deep crawling.
When analysis logs already exist, run python report_engine_only.py, or supply a subject with python report_engine_only.py --query "Civil engineering industry analysis". The CLI also supports --skip-pdf, --skip-markdown, and --verbose. At least one of insight_engine_streamlit_reports, media_engine_streamlit_reports, or query_engine_streamlit_reports must contain a .md report.
Safety boundaries, hardening & integrations
Operational blast radius, source-verified safety controls, and first-run hardening steps before connecting this agent to real workspaces.
Declared capability surface (blast radius)
Can run terminal commands; pair with approval gates or container/OS sandboxing.
Modifies local files; work on a clean Git branch or dedicated worktree.
Makes outbound requests; verify telemetry settings and model data routing on private repos.
FARS trust-control audit
- rollback or recovery path — Back up first, or work on a git branch or snapshot, so its changes can be undone.
What are this agent's strengths and limitations?
- Separate engines handle search, multimodal material, private databases, and reporting, while ForumEngine adds moderated, multi-round coordination between them.
- ReportEngine uses a validated Document IR and clearly separates template selection, document layout, word budgeting, chapter generation, and HTML/PDF/Markdown rendering.
- Each model-backed component can be configured with its own API_KEY, BASE_URL, and MODEL_NAME through an OpenAI-compatible interface instead of one named model vendor.
- The repository offers Docker Compose deployment, a Flask interface, standalone Streamlit apps, crawler commands, and a headless report-generation CLI.
- Sentiment support includes multilingual, BERT LoRA, GPT-2 LoRA, small Qwen3, and traditional machine-learning implementations rather than relying exclusively on general-purpose language models.
- Operators must supply and maintain model endpoints, a database, and a Playwright browser; the full stack is not a zero-configuration executable or hosted service.
- Crawler use carries compliance obligations for robots.txt, site terms, and applicable law, and the project assigns resulting legal responsibility to the user.
- The project disclaimer restricts use to learning, academic research, and education, explicitly prohibiting commercial use and commercial decision-making from its analysis.
- PDF export requires WeasyPrint and additional operating-system packages; without them, installation or PDF generation may fail.
- The source claims broad social coverage and large comment volumes but provides no quantitative evidence here for current per-platform availability, crawl reliability, rate limits, or analytical accuracy.
- Full research depends on network access, external model services, and configured data sources, so outages, exhausted quotas, or missing engine outputs can reduce or stop the workflow.
How does this agent compare with similar options?
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| BettaFish Public Opinion Research This agent | 42 · Major gaps | Self-hosted serviceFree + model costs | ★ 43k | 2mo ago | Python | OpenAI API |
| Business Analytics Agent | 61 · Some gaps | Desktop appFree + model costs | ★ 2.6k | 5d ago | JavaScript | OpenAI API |
| FinRobot | 48 · Major gaps | CLIFree + model costs | ★ 8.5k | 1d ago | Python | OpenAI API |
| DATAGEN Research Assistant | 45 · Major gaps | CLIFree + model costs | ★ 1.8k | 19d ago | Python | OpenAI API · Claude API |
How does FollowAgents rate this agent?
Why each dimension lost points
The code shows database connections, public-platform crawling, external LLM/API calls, and optional QR-code or cookie login, establishing meaningful external data and account effects. The excerpt does not adequately show privilege restriction, user confirmation, end-to-end data flows, or sensitive-data lifecycle controls, so those criteria receive 1. Some dependencies are pinned while others have broad version ranges, with no shown vulnerability response evidence; dependency security receives 1. No rollback or revocation path is shown (0). Source attribution and maintenance/update responsibility are also unclear (1).
Database, configuration, and crawling failures produce logs or error results, with reasonably specific failure messages (2). However, the sample shows possible inconsistencies around configuration references and module entry points, so self-consistency receives 1. Dependencies are listed but not all locked, and availability depends on external services, browser infrastructure, and model providers, so dependency availability receives 1.
The README describes public-opinion research and decision support, and outlines Query, Media, Insight, Report, and standalone applications, adequately covering audiences and scenarios (2). Supported platforms, login modes, and task parameters are specified, but overall capability boundaries and trigger conditions are limited (1 each). Although multiple operating systems are claimed, setup favors specific environments and requires substantial external service and database configuration, so environment fit receives 1.
The README provides a module tree, workflow, quick start, and sample report, supporting information architecture and examples (2 each). The supplied installation guidance covers only part of Docker and configuration setup, and the Python-version entry is incomplete (1). Module naming is mostly stable (2). Some usage advice is present, but limitations and maintenance responsibility are thin (1 each). The repository includes the GPL-2.0 license text (3). The README shows a version and CI publishes tagged images, but this packet shows no changelog (versioning/changelog 1). Publisher identity is unverified and no maintainer responsibility is clear (1).
The described workflow produces HTML/PDF reports from collection and collaborative analysis, and a sample report is referenced, supporting output usability (2). Multi-agent specialization, opinion collection, and report generation provide clear incremental value (2). The system depends on multiple model/API services, a database, crawlers, and heavyweight machine-learning packages, while the supplied material does not quantify costs or show cost controls (1).
The README gives architecture and workflow details, and the code sample corroborates parts of configuration checking, error handling, and crawling. Claims about scale, platform coverage, accuracy, and prediction are not substantiated in the supplied material, so claim traceability receives 1. Sources corroborate some architecture details, but the packet does not include complete core-agent implementations (1). Product claims do not consistently distinguish implemented capabilities from goals or inference (1).
- Not found in source: rollback or recovery pathBack up first, or work on a git branch or snapshot, so its changes can be undone.
- The README claims large-scale, continuous collection and broad multimodal platform coverage; the supplied material does not establish the implementation or accuracy of those claims.
- Deployment requires database and model/API configuration and may use QR-code or cookie login; review credential storage, data transfers, and target-platform rules before deployment.
- Some dependencies use open-ended version ranges, and the supplied material contains no dependency vulnerability review.
Recent releases
Latest entries from the project's GitHub Releases. Notes are quoted from upstream as written, not rewritten or tested by FollowAgents.
-
v3.0.0 微舆v3.0.0
Release notes excerpt
预测引擎 MiroFish-v0.1.0 发布🎉 查看我们最新发布的预测引擎:[MiroFish-简洁通用的群体智能引擎,预测万物](https://github.com/666ghj/MiroFish) <div align="center"> <img src="https://github.com/user-attachments/assets/fba934e7-3d8e-4cf3-b81b-c4538acd3e56" alt="banner" width="500"> </div> “数据分析三板斧”全线贯通:我们激动的宣布 MiroFish 正式发布!随着最后一块版图补齐,我们构建了从 BettaFish(数据收集与分析)到 MiroFish(全景预测)的完整链路。至此,从原始数据到智能决策的闭环已成,让预见未来成为可能! <img width="1502" height="990" alt="04fb364a3122e3ec7dfab8929897745a" src="https://github.com/user-attachments/assets/c5a987b2-3ce5-460f-b671-f2f700db1377" />View on GitHub ↗ -
v2.1.0 微舆v2.1.0
Release notes excerpt
What's Changed * feat(insight_agent): Insight Agent新增了DeepSearchAgent._cluster_and_sample_results()方法,该方法对搜索结果进行文本编码,使用 KMeans 聚类并按热度排序采样,然后从每个聚类中选取代表性语义返回 by @ghmark675 in https://github.com/666ghj/BettaFish/pull/350 * feat(xhs): 集成xhshow库优化签名生成与请求参数 by @ptghb in https://github.com/666ghj/BettaFish/pull/330 * Feat: 同样的效果更经济的搜索选择,新增安思派AI搜索支持 (#457) by @666ghj in https://github.com/666ghj/BettaFish/pull/461 * Shutdown only clean 增加安全关闭系统的功能 by @HKLHaoBin in https://github.com/666ghj/BettaFish/pull/441 * Update Via main by @MaYiding in https://github.com/666ghj/BettaFish/pull/463 …View on GitHub ↗ -
v2.0.0 微舆 v2.0.0
Release notes excerpt
版本概述 微舆BettaFish 是一个基于多智能体的舆情分析系统,致力于打破信息茧房并提供权威、深度的舆情洞察。v2.0.0 是 BettaFish 一次里程碑式的大版本,我们全面重构了报告引擎,增强了弱模型适配与长文稳定性,实现了原子级可控与标准化交付。修复大量BUG的同时针对性能瓶颈进行了专项优化,系统运行内存占用已降至 1GB 以内。 微舆 v2.0.0 在稳定性、可配置性及部署便利性上迈出了重要一步。我们希望此版本能为你带来更高效、更可靠的体验。 ✨ Report Engine V2 标准化生成流水线 现在的 Report Agent 遵循以下七阶段严谨流程,确保不同llm生成的报告的样式、内容统一与可控,提高了导出pdf的美观: 1. 多源情报聚合:自动汇总多 Agent 的中间产物与论坛记录,构建全景信息底座。 2. 智能模板匹配:内置多套专业舆情分析模板,系统根据内容特征自动择优匹配。 3. 架构与切片设计:由 LLM 顶层设计报告标题、目录结构、Hero 模块及整体视觉风格,并选定适配的 HTML 模板。 4. 章节任务规划:自动拆解篇章结构,生成细粒度的章节编写任务清单。 …View on GitHub ↗
FAQ
Does BettaFish require an official OpenAI model?
Can it be adopted for commercial monitoring or business decisions?
Must MindSpider run before a report can be generated?
Which databases are supported?
What happens if PDF dependencies are unavailable?
--skip-pdf. Markdown is also generated by default unless --skip-markdown is supplied.Thanks — we use this to improve the page.
Subscribe to the FollowAgents RSS feed, or save this agent to your browser shortlist to compare on your next visit.