Assistant

Project Details

Assistant is a personal Telegram bot built for experimentation and learning around agentic workflows, background processing, and finance-focused utilities. It runs as an ASP.NET Core webhook API and combines natural-language chat, reminder and task handling, live TEFAS fund analysis, and credit card statement PDF analysis in a single Telegram-first interface. Agent behaviors are implemented with Microsoft Agent Framework, with custom personality, memory, and task-awareness layers tailored for Telegram conversations.

Key Features

  • /chat runs a tool-enabled conversational agent that keeps per-user context, understands natural-language reminder requests, and can pull in fresh web information when the question depends on recent facts.
  • /expense shows the current expense summary and can analyze uploaded credit card statement PDFs.
  • /tefas <FUND_CODE> fetches live TEFAS data, normalizes fund metrics, and returns an AI-assisted summary with a deterministic fallback.
  • Incoming Telegram updates are validated, queued, and processed asynchronously through Hangfire jobs.

Technical Implementation

  • Built with ASP.NET Core 10, Telegram.Bot, PostgreSQL, and Hangfire using a webhook-driven architecture.
  • Designed an extensible command pipeline around IBotCommand, BotCommandFactory, and a centralized update handler.
  • Used Microsoft Agent Framework to structure agent execution, tool-enabled interactions, and conversational flows.
  • Configured the chat agent with personality injection, saved user memories, pending-task context, current-time resolution, web search, and one-time or recurring task scheduling tools.
  • Preserved conversation continuity with per-chat sessions and chat history summarization so the agent can carry forward open loops, decisions, and user preferences across longer Telegram threads.
  • Integrated Google Gemini for chat, reminder interpretation, expense analysis, and fund summarization.
  • Added document processing by sending uploaded PDFs to Markitdown, extracting statement text, and persisting billing-period expense summaries.
  • Implemented live TEFAS scraping and HTML parsing to convert fund pages into structured snapshots before AI summarization.
  • Secured the webhook flow with Telegram secret-token validation and optional allowed chat ID checks.

Project Link