666ghj/BettaFish
Self-hosted multi-agent research for public-opinion analysis and reporting
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
BettaFish is a modular Python application for public-opinion research, not a general-purpose agent SDK. The Flask entrypoint in app.py starts QueryEngine, MediaEngine, and InsightEngine in parallel for web search, multimodal research, and analysis of database-backed opinion data. After an initial sweep, each agent plans follow-up research. ForumEngine uses an LLM moderator to synthesize agent discussion and steer later rounds; ReportEngine consumes both the findings and the discussion to assemble a structured document intermediate representation (IR).
The runtime includes Flask 2.3.3 and Flask-SocketIO 5.3.6, with Streamlit 1.28.1 for standalone engine interfaces. Engine directories separate orchestration, nodes, tools, state, and prompts. Models are invoked through OpenAI-compatible clients, while provider and domain customization happens through per-engine settings, Python tools, and prompts. InsightEngine's async SQLAlchemy read-only wrappers provide a concrete starting point for database integrations; a new business schema still needs its own queries and access policy.
Key Capabilities & Differentiators
QueryEngine handles broad web and news research; MediaEngine handles images, short videos, and structured search cards; InsightEngine retrieves topics and comments and can apply sentiment analysis. Available sentiment implementations include multilingual, small fine-tuned Qwen3, Chinese BERT LoRA, GPT-2 LoRA, and traditional options such as SVM. The sample settings show where to bound work: Query allows two reflection rounds and 15 search results, while Insight caps the number of search results passed to the LLM at 50. These are configuration examples, not throughput or quality guarantees.
ReportEngine can select a built-in template or use a custom Markdown or text template, check output in sections, and render interactive HTML from Document IR. Markdown and optional PDF are also supported. The report_engine_only.py command can regenerate a synthesis from existing engine reports without rerunning research; separate re-render scripts rebuild HTML or Markdown from saved chapter JSON and export PDF from a saved IR. When selecting the latest files per engine for a report-only run, verify that they belong to the same topic and time window.
Trade-offs & Limitations
Compared with a web-only deep-research agent, BettaFish offers a path from database and media evidence to reusable report artifacts without building the entire pipeline yourself. The additional research rounds, moderator calls, and synthesis stages can increase elapsed time and API spend, and multiple agents do not make shared sources independent or summaries automatically reliable. Compared with a managed social-listening service, you gain control over models, queries, and templates but take on source maintenance, credentials, provider limits, and validation of actual coverage. The Flask workflow does not start MindSpider for you.
A practical pilot should test source freshness, trace material conclusions back to evidence, and measure cost per completed report using representative queries. Self-hosted storage can coexist with externally processed prompts, so map data flows before using private records. The repository identifies GPL-2.0, while its disclaimer separately prohibits commercial or for-profit use. Those terms are in tension and warrant legal review before commercial rollout; crawler use also requires a separate check of site terms, robots.txt, and data rights.
Hardware & Deployment Guide
For self-hosting, copy .env.example to .env, configure the required model and search credentials, set DB_HOST=db and DB_PORT=5432 for the Compose database, and run docker compose up -d. The stack uses ghcr.io/666ghj/bettafish:latest and PostgreSQL 15. Flask listens on port 5000, and Compose also publishes Streamlit ports 8501–8503; restrict exposure to the interfaces users actually need. Bind mounts retain logs, final reports, and per-engine reports. For repeatable deployments, pin the tested image by digest rather than relying on the floating latest tag.
Source installs support Python 3.9+, with Python 3.11 shown in the environment setup. Install requirements.txt and start python app.py; add Playwright Chromium for crawling and WeasyPrint system dependencies if PDF output is needed. PostgreSQL is recommended and MySQL is configurable. Start with the 2 GB-plus memory recommendation, then size for concurrent runs, browser processes, and any local models. Self-hosting does not imply offline operation: check where model requests go and which search paths require network access. Release v2.0.0 rebuilt reporting, v2.1.0 added KMeans-based representative sampling in Insight, and v3.0.0 points to MiroFish as a separate downstream forecasting project.
Research and teaching teams that want to combine authorized social or internal datasets with web and media evidence and generate reusable reports from natural-language questions.
You need turnkey continuous monitoring, guaranteed platform coverage, an entirely offline workflow without replacing external dependencies, or clear commercial-use terms without legal review.
Quick Start & Installation
docker compose up -d
Comparison vs. Top Agents & Frameworks Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| BettaFish ★ | 42.8k | +59 | Python | GPL-2.0 | Self-hosted multi-agent research for public-opinion analysis and reporting |
| deer-flow | 86.1k | +257 | Python | MIT | Self-hosted LangGraph agent runtime for long-running research, coding, and conte |
| nanobot | 50.5k | +157 | Python | MIT | A self-hosted Python gateway for personal AI across web, terminal and chat. |
| pentagi | 35.7k | +489 | Go | MIT | Self-hosted multi-agent penetration testing with logs and reports for human revi |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/666ghj/BettaFish.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about BettaFish
How do I connect an internal feedback database?
Do I need a GPU, and how should I size a host?
Does self-hosting resolve privacy and commercial-use concerns?
When is BettaFish a better fit than a search agent or social-listening service?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy