← Back to Leaderboard
B666ghj

666ghj/BettaFish

Self-hosted multi-agent research for public-opinion analysis and reporting

Open-Source AI AppQuickstart ↓
Engineering Health (Methodology)
B+ · 73/100
Maintenance Activity
● Updated 1mo ago
Latest Release
v3.0.0
Commercial License Check
GPL-2.0 · Copyleft Warning

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance26/35
Fork Adoption25/25
Release Cadence11/20
License Clarity11/20
DockerSelf-HostedAPI1 README badge views (30d)
Total Stars
★ 42,839
24h Growth
+3
7d Growth
+59
Forks
7,642

GitHub Star History

Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.

666ghj/BettaFish Star History (2024-07-04 - 2026-12-04) ALL-TIME STAR HISTORY (2024-07 – 2026-12) +42.8k in 883d · avg +49/day 45.2k 22.6k 0 2024-07-04: ★ 12024-08-31: ★ 22024-10-26: ★ 132024-12-21: ★ 892025-02-15: ★ 1722025-04-12: ★ 2322025-06-07: ★ 2432025-08-02: ★ 2462025-09-27: ★ 6192025-11-22: ★ 27,5872026-01-17: ★ 33,4732026-03-14: ★ 37,6852026-05-09: ★ 40,0822026-07-04: ★ 41,0782026-08-29: ★ 41,7892026-10-24: ★ 42,3912026-12-04: ★ 42,839 ★ 42.8k 2024-07 2025-09 2026-12

Evidence-Backed Technical Brief

AI Deep Review

Architecture & 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 lanes: Query, Media, and Insight run in parallel; ForumEngine feeds moderator guidance back into subsequent research rounds.
Model configuration: Each engine can use a separately configured OpenAI-compatible endpoint through its API key, base URL, and model name.
Database retrieval: InsightEngine uses async SQLAlchemy read-only wrappers, with example caps of 500 comments per fetch and 50 search results passed to the LLM.
Report generation: A shared Document IR drives interactive HTML, Markdown, and optional PDF output, with scripts to re-render saved artifacts.
Collection boundary: MindSpider runs separately from the Flask analysis app; browser-based source installs use Playwright Chromium.
Operational entrypoints: Docker Compose pairs the application with PostgreSQL 15; three individual engines also have Streamlit entrypoints.
Best For

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.

Skip If

You need turnkey continuous monitoring, guaranteed platform coverage, an entirely offline workflow without replacing external dependencies, or clear commercial-use terms without legal review.

Reviewed on 2026-12-03 · Grounded in GitHub README, root file tree & releasesMethodology

Quick Start & Installation

DockerSelf-HostedAPI
docker compose up -d

Comparison vs. Top Agents & Frameworks Alternatives

Full comparison →
RepositoryStars7d TrendStackLicenseCore Positioning
BettaFish ★42.8k+59PythonGPL-2.0Self-hosted multi-agent research for public-opinion analysis and reporting
deer-flow86.1k+257PythonMITSelf-hosted LangGraph agent runtime for long-running research, coding, and conte
nanobot50.5k+157PythonMITA self-hosted Python gateway for personal AI across web, terminal and chat.
pentagi35.7k+489GoMITSelf-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.

Raw .md ↗
curl -sL https://repoforai.com/repo/666ghj/BettaFish.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

666ghj/BettaFish Star History on RepoForAI

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?

Use the InsightEngine tool layer as the integration point. The existing path uses an async SQLAlchemy engine with read-only query wrappers; the custom-tool example shows where to add business-specific queries but leaves their implementation to you. Use a least-privilege database account and verify which rows or excerpts are sent to the configured model endpoint.

Do I need a GPU, and how should I size a host?

No local GPU is needed for inference when all LLM calls go to an external API and the optional local sentiment models are omitted. The starting memory recommendation is at least 2 GB, not a production capacity estimate. Size against concurrent analysis runs, Chromium processes if you enable crawling, and the footprint of any local model you choose. No exact VRAM requirement is specified.

Does self-hosting resolve privacy and commercial-use concerns?

Self-hosting the application does not keep all data on-premises if the agents use external model or search endpoints. Use authorized data, check site terms and robots.txt before crawling, and restrict access to logs and reports. The repository lists GPL-2.0, while its disclaimer separately says commercial and for-profit use is prohibited. Those statements are in tension; have counsel assess the licensing terms before commercial adoption.

When is BettaFish a better fit than a search agent or social-listening service?

Choose BettaFish over a generic deep-research agent when you need to combine web and media research with SQL-backed opinion data and export the result through a template-based reporting pipeline. A narrower search agent has fewer dependencies for web-only briefs. For continuous alerting, stable coverage commitments, or managed operations, evaluate a dedicated social-listening service; the included crawler runs separately, and platform coverage should be validated in your own environment.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining 666ghj/BettaFish? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature 666ghj/BettaFish on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

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

Saved in your browser · Export Markdown RFC tables or jump into /vs compare