{"id":29635057,"url":"https://github.com/mscbuild/taskbot","last_synced_at":"2025-07-21T16:09:34.453Z","repository":{"id":303947911,"uuid":"1017253757","full_name":"mscbuild/TaskBot","owner":"mscbuild","description":"🤖 TaskBot: A Telegram Task Management Bot (router -\u003e analysis -\u003e processing -\u003e response)","archived":false,"fork":false,"pushed_at":"2025-07-10T10:06:44.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-10T17:14:42.843Z","etag":null,"topics":["backend","bot","control","messages","python","response","service","task","telegram"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mscbuild.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-10T08:55:10.000Z","updated_at":"2025-07-10T10:08:53.000Z","dependencies_parsed_at":"2025-07-10T17:15:36.391Z","dependency_job_id":"18ecfe4d-c7e9-4086-af97-616450c93485","html_url":"https://github.com/mscbuild/TaskBot","commit_stats":null,"previous_names":["mscbuild/taskbot"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/mscbuild/TaskBot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mscbuild%2FTaskBot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mscbuild%2FTaskBot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mscbuild%2FTaskBot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mscbuild%2FTaskBot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mscbuild","download_url":"https://codeload.github.com/mscbuild/TaskBot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mscbuild%2FTaskBot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266332680,"owners_count":23912663,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backend","bot","control","messages","python","response","service","task","telegram"],"created_at":"2025-07-21T16:09:33.784Z","updated_at":"2025-07-21T16:09:34.435Z","avatar_url":"https://github.com/mscbuild.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TaskBot: A Telegram Task Management Bot\n ![](https://komarev.com/ghpvc/?username=mscbuild) \n ![](https://img.shields.io/github/license/mscbuild/TaskBot) \n ![](https://img.shields.io/badge/PRs-Welcome-green)\n ![](https://img.shields.io/github/languages/code-size/mscbuild/TaskBot)\n![](https://img.shields.io/badge/code%20style-python-green)\n![](https://img.shields.io/github/stars/mscbuild)\n![](https://img.shields.io/badge/Topic-Github-lighred)\n![](https://img.shields.io/website?url=https%3A%2F%2Fgithub.com%2Fmscbuild)\n\n\n## Overview\n\nTaskBot is a Telegram bot built with Python 3.12, aiogram, SQLAlchemy, and LangChain. It allows users to manage tasks (create, read, update, delete, and list) using natural language, with LLM-driven intent analysis. The architecture follows a layered approach (router -\u003e analysis -\u003e processing -\u003e response) with strict CRUD separation, memory-layer abstraction, and access control.\n\n## Features\n\n- Create, read, update, delete, and list tasks via Telegram commands or natural language.\n- LLM-driven intent analysis using LangChain for processing user input.\n- Strict CRUD operations with SQLAlchemy for database interactions.\n- User-specific access control to ensure data privacy.\n- Type-safe code with Pydantic models and Python 3.12 type hints.\n- Asynchronous operations for scalability using aiogram and async SQLAlchemy.\n- Minimal unit tests with pytest for core functionality.\n\n## Project Structure\n\n```\ntaskbot/\n├── bot.py           # Main bot code (router, analysis, processing, repository, tests)\n├── README.md       # Project documentation\n└── requirements.txt # Project dependencies\n```\n\n- **Router**: Handles Telegram messages using aiogram.\n- **Analysis**: Uses LangChain to parse user intent (e.g., \"create task: buy groceries\").\n- **Processing**: Executes business logic with strict separation of concerns.\n- **Memory Layer**: Abstracts database operations using SQLAlchemy.\n- **Access Control**: Ensures users can only access their own tasks.\n\n## Requirements\n\n- Python 3.12+\n- Telegram Bot Token (obtain from [BotFather](https://t.me/BotFather))\n- Dependencies (listed in `requirements.txt`):\n  - aiogram\n  - sqlalchemy[asyncio]\n  - langchain\n  - langchain-community\n  - pydantic\n  - pytest\n  - pytest-asyncio\n\n## Setup\n\n1. **Clone the Repository**:\n   ```bash\n   git clone https://github.com/mscbuild/TaskBot\n   cd taskbot\n   ```\n\n2. **Install Dependencies**:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n3. **Configure the Bot**:\n   - Replace `\"YOUR_BOT_TOKEN\"` in `bot.py` with your Telegram bot token.\n   - (Optional) Replace the `FakeListLLM` in `bot.py` with a real LLM (e.g., OpenAI or HuggingFace) for production use. Configure API keys as needed.\n\n4. **Set Up the Database**:\n   - The bot uses an in-memory SQLite database by default (`sqlite+aiosqlite:///:memory:`).\n   - For production, update the database URL in `bot.py` to use a persistent database (e.g., PostgreSQL: `postgresql+asyncpg://user:password@localhost/dbname`).\n\n5. **Run the Bot**:\n   ```bash\n   python bot.py\n   ```\n\n## Usage\n\n1. Start the bot by sending `/start` in Telegram.\n2. Send natural language commands, e.g.:\n   - \"Create a task: Buy groceries\"\n   - \"List my tasks\"\n   - \"Update task 1: Buy groceries and milk\"\n   - \"Delete task 1\"\n   - \"Show task 1\"\n3. The bot will respond with the result of the action (e.g., \"Task created: Buy groceries (ID: 1)\").\n\n## Testing\n\nRun unit tests to verify CRUD operations:\n```bash\npytest bot.py\n```\n\nThe tests cover:\n- Creating a task\n- Reading a task\n- Updating a task\n- Listing tasks\n- Deleting a task\n\n## Extending the Bot\n\n- **Custom LLM**: Replace `FakeListLLM` with a production-ready LLM (e.g., `langchain_openai.OpenAI`) and configure API keys.\n- **Database**: Switch to a persistent database like PostgreSQL for production.\n- **Additional Features**: Extend the `TaskAnalyzer` to support more complex intents or add new commands in `TaskBot`.\n\n## Notes\n\n- The bot uses an in-memory database for simplicity. For production, use a persistent database to retain data.\n- Ensure your Telegram bot token is kept secure and not exposed in version control.\n- The `FakeListLLM` is used for testing. For real-world use, integrate a proper LLM and handle rate limits or errors.\n\n## License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmscbuild%2Ftaskbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmscbuild%2Ftaskbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmscbuild%2Ftaskbot/lists"}