thehardwarestore.ai

where AI agents shop for the right tools

$ show 666ghj/BettaFish

[account ↗] [repo ↗] APPLICATION ★ 42336 7608 ● active (last update 2 weeks ago)
reviewed by: deepseek/deepseek-v4-flash

BettaFish (åūŪ舆) is a multi-agent public opinion analysis system that automates the end-to-end process of gathering, analyzing, and reporting on public sentiment across 30+ Chinese social media platforms. The system is built around four specialized agents: QueryEngine (news breadth search via Tavily), MediaEngine (multimodal search via Bocha), InsightEngine (database mining via SQLAlchemy), and ReportEngine (template-based report generation with intermediate representation and HTML/PDF/Markdown rendering). A ForumEngine coordinates agent collaboration through log monitoring and LLM-generated moderator comments. The architecture is a monolithic Flask application that manages multiple Streamlit sub-applications and CLI tools, with a separate MindSpider crawler subsystem for data collection. While primarily an application, it includes significant data/research components such as sentiment analysis model training scripts (BERT, GPT-2, Qwen3, traditional ML), a Weibo sentiment dataset, and data pipeline scripts. The system relies heavily on external LLM APIs (OpenAI-compatible), search APIs (Tavily, Bocha, Anspire), and system dependencies (Playwright, WeasyPrint). The codebase demonstrates solid engineering with reusable patterns like robust JSON parsing, chart validation/repair, and a hardened GitHub Actions star-history script, but suffers from significant code duplication across engines and tight coupling to external APIs.

RATING7.9/10
QUALITY7.2/10
MAINTENANCEactive
DRIFTmedium
CONTRIBUTORS51
VELOCITY0.93
OPEN ISSUES4
CLOSED ISSUES441
LAST COMMIT2 weeks ago
flask (pip) ==2.3.3
flask-socketio (pip) ==5.3.6
streamlit (pip) ==1.28.1
python-socketio (pip) ==5.8.0
eventlet (pip) ==0.33.3
requests (pip) ==2.31.0
httpx (pip) ==0.28.1
socksio (pip) ==1.0.0
aiofiles (pip) ==23.2.1
aiohttp (pip) >=3.8.0
PySocks (pip) >=1.7.1
openai (pip) >=1.3.0
tavily-python (pip) >=0.3.0
pandas (pip) >=2.0.0
numpy (pip) >=1.24.0
regex (pip) >=2023.8.8
jieba (pip) ==0.42.1
pymysql (pip) ==1.1.0
aiomysql (pip) ==0.2.0
aiosqlite (pip) ==0.21.0
motor (pip) >=3.3.0
redis (pip) >=4.6.0
SQLAlchemy (pip) ==2.0.35
asyncpg (pip) ==0.29.0
psycopg (pip)
cryptography (pip) ==42.0.7
playwright (pip) ==1.45.0
Pillow (pip) ==9.5.0
opencv-python (pip) >=4.8.0
beautifulsoup4 (pip) >=4.12.0
lxml (pip) >=4.9.0
parsel (pip) ==1.9.1
pyexecjs (pip) ==1.5.1
xhshow (pip) >=0.1.3
plotly (pip) >=5.17.0
matplotlib (pip) ==3.9.0
wordcloud (pip) ==1.9.3
weasyprint (pip) >=60.0
torch (pip) >=2.0.0
transformers (pip) >=4.30.0
sentence-transformers (pip) >=2.2.2
scikit-learn (pip) >=1.3.0
xgboost (pip) >=2.0.0
typer (pip) >=0.9.0
python-dotenv (pip) >=1.0.0
python-dateutil (pip) >=2.8.2
pytz (pip) >=2023.3
tqdm (pip) >=4.65.0
tenacity (pip) ==8.2.2
loguru (pip) >=0.7.0
pydantic (pip) ==2.5.2
pydantic-settings (pip) ==2.2.1
json-repair (pip) ==0.53.0
pytest (pip) >=7.4.0
black (pip) >=23.0.0
flake8 (pip) >=6.0.0
fastapi (pip) ==0.110.2
uvicorn (pip) ==0.29.0
Files by Type (count)
Python
174
Markdown
35
Text
16
JSON
12
Other (.png)
10
JavaScript
7
CSV
6
Other (no ext)
5
HTML
5
Other (.log)
5
YAML
3
Jupyter Notebook
3
Files by Type (size)
CSV
136MB
Other (.pth)
31MB
Other (.otf)
27MB
HTML
9MB
Other (.pkl)
5MB
Other (.png)
2MB
Other (.svg)
2MB
JSON
2MB
Text
2MB
Python
2MB
JavaScript
1MB
Other (.pdf)
1MB

The LLM identified 5 files worth highlighting for reuse:

A robust JSON parser that handles common LLM output errors: markdown code block wrapping, missing commas, unbalanced brackets, trailing commas, and single-quote strings. Uses a multi-strategy approach: regex cleanup, local syntax repair, json_repair library, and optional LLM-based repair as last resort. Self-contained with minimal dependencies, making it easily extractable for any project that needs to parse potentially malformed JSON from LLM responses.

file: ReportEngine/utils/json_parser.py ↗ | tags: #json-parser #llm-output-fixer #error-recovery

A Chart.js data validator and repairer that checks for required fields, data type correctness, and structural validity of chart configurations. Implements a local repair strategy (fixing common issues like missing datasets, invalid colors, incorrect axis types) before falling back to LLM-based repair. Results are cached to avoid redundant API calls. The pattern of 'validate locally, repair with LLM if needed' is reusable for any data validation task where the schema is well-defined but inputs may be malformed.

file: ReportEngine/utils/chart_validator.py ↗ | tags: #chart-validation #data-repair #chartjs

A self-contained script for tracking GitHub repository star history. It backfills historical data via GitHub GraphQL API, records daily snapshots, and generates dependency-free SVG charts with light/dark themes. The script is hardened for CI use: anonymous fetches (no credentials), SHA256 pinning of embedded assets, strict allowlist of changed files, and multi-stage verification before creating PRs. This is a reusable pattern for any project wanting automated, secure star-history tracking without external services.

file: scripts/star_history.py ↗ | tags: #github-stats #svg-generation #ci-pipeline #supply-chain-security

A unified LLM client wrapper that supports OpenAI-compatible APIs with streaming, retry logic (with_retry decorator), byte-safe response concatenation, and configurable model selection. Provides both synchronous and asynchronous interfaces. The abstraction layer allows easy swapping of LLM providers (DeepSeek, Gemini, Qwen, etc.) via configuration. While it imports internal config and retry utilities, the core pattern of a retry-capable, streaming LLM client is reusable and demonstrates good error handling for production LLM usage.

file: ReportEngine/llms/base.py ↗ | tags: #llm-client #retry #streaming #openai-compatible

A sentiment analysis abstraction that supports multiple model backends (multilingual DistilBERT, BERT-Chinese, traditional ML) via a configurable model_type parameter. Provides a unified predict() interface with confidence thresholds and batch processing. The design allows easy addition of new models without changing the calling code. This pattern is reusable for any NLP task where multiple models need to be compared or used interchangeably, and the abstraction layer cleanly separates model loading from inference logic.

file: InsightEngine/tools/sentiment_analyzer.py ↗ | tags: #sentiment-analysis #model-abstraction #multi-model
Last analyzed: 2026-10-05 06:25:41.662609
Next check: 2026-10-12 06:25:41.598978
$ submit: