How privateai-com/research-ai works
Project type and purpose
• This is a multi-component research assistant system (“research-ai”) that consists of three cooperating services:
• A Telegram Bot interface (bot/)
• A background Agent service (agent/)
• A REST API service (api/)
• Shared code (shared/) provides the database layer, LLM config, logging, and utilities.
• It implements a queue-based, multi-stage research pipeline that queries external sources (arXiv, Google Scholar, PubMed, GitHub), ranks and analyzes results with an LLM, then notifies users.
File structure
• Top-level directories:
• agent/ – orchestrator (manager.py) + pipeline stages (pipeline/) + source tools (browsing/)
• bot/ – Telegram handlers, notification logic, main entrypoint (main.py)
• api/ – FastAPI app (app.py) exposing REST endpoints
• shared/ – DB connection & operations, LLM config, event system, logging
• tests/ – automated tests for API, pipeline, and sources
• Start-scripts: start_bot.py, start_agent.py, start_api.py
• Config/build files: .env.example, pyproject.toml, quality-check.py
Readme insights
• Task flow: Bot/API → TaskQueue → Agent Manager → Pipeline → Sources & LLM → DB updates → Bot/API notifications
• Database: SQLite via SQLAlchemy, core models (User, TaskQueue, TaskStatistics, RateLimit), agent models (ResearchTopic, ArxivPaper, PaperAnalysis, UserSettings)