Telegram AI Copilot for Business Client Conversations
ClientPilot AI is a Laravel-based Telegram bot for human-in-the-loop client conversation management. It helps review incoming business messages, generate AI-assisted replies, keep conversation memory, and surface safety risks while the user still manually decides what to send.
- Receives client/job messages through Telegram
- Creates per-client conversation records
- Generates native-language client analysis for the user
- Suggests ready-to-send replies in the selected client reply language
- Stores the reply the user actually sent
- Supports feedback, custom reply logging, regenerate, memory summary, and risk-aware guidance
ClientPilot AI does not send messages automatically to external marketplaces or communication platforms.
The workflow is intentionally manual:
- AI analyzes and suggests
- The user reviews inside Telegram
- The user manually sends the final reply on the target platform
- The bot stores the selected or custom reply for continuity
Current implemented flow:
/start+ New Client- Select target reply language
- Paste the client/job message
- Receive native-language Client Analysis
- Start chat for that client
- Paste each new client message
- Receive ready-to-send reply suggestions
- Use available actions:
- Select sent option
- Feedback
- Custom reply
- Regenerate
- Pause / resume / close client
- View summary
ClientPilot AI separates internal user-facing language from client-facing reply language.
NATIVE_LANGUAGEis global- Static Telegram bot UI/messages use
NATIVE_LANGUAGE - Client Analysis is
NATIVE_LANGUAGEonly reply option target_textusesclient.target_languagenative_meaningusesNATIVE_LANGUAGE
Supported target reply languages:
- English
- Turkish
- Spanish
- Portuguese
Existing clients without a stored target_language fall back to the global TARGET_LANGUAGE config.
config/upwork_profile.php is used as Mehrdad's verified profile context for reply suggestion grounding.
This context is used to help the AI:
- ground replies in verified skills, services, and projects
- use direct claims only when supported
- use adjacent wording when the job is related but not an exact profile match
- avoid inventing projects, links, clients, or exact experience
The profile config is treated as verified context only. It is not a public portfolio page and should not contain secrets.
Risk Guard reviews risky client situations during reply suggestion generation.
It currently focuses on cases such as:
- off-platform communication requests
- off-platform payment requests
- starting before funded milestone / clear agreement
- unpaid sample requests
- suspicious files
- sensitive credential requests
- unrealistic deadlines
- oversized scope with weak budget signals
Important behavior:
- technical mentions like
WhatsApp Business APIorMeta Cloud APIshould not be treated as off-platform communication by themselves - actual off-platform communication/payment requests should still be treated carefully
- Risk Guard warns and steers replies to a safer path; it does not block the user from continuing
- Laravel
- PHP
- MySQL
- Telegram Bot API
- OpenAI-compatible AI provider
- Queues / Jobs
- PHPUnit tests
Relevant configuration values include:
NATIVE_LANGUAGE=fa
TARGET_LANGUAGE=en
TARGET_PLATFORM_NAME=UpworkNATIVE_LANGUAGE: global language for bot-facing explanations shown to the userTARGET_LANGUAGE: global fallback reply languageTARGET_PLATFORM_NAME: configurable marketplace/platform display name
The platform name is configurable so the same structure can later be used for Upwork, Freelancer, Fiverr, LinkedIn, or similar client conversation workflows.
Typical production maintenance commands:
php artisan migrate --force
php artisan optimize:clear
php artisan queue:restartIf you run queue workers under Supervisor, restart the worker process after deployment.
Run the test suite with:
php artisan test- Do not commit
.env - Do not commit real Telegram tokens, AI keys, webhook secrets, passwords, or private credentials
- Keep reply automation disabled unless you intentionally build that in a future scope
- AI request logging should stay masked for sensitive payload content
The current implementation includes:
- Telegram webhook + allowed user flow
- Client creation and management
- Per-client target reply language selection
- Native-only Client Analysis
- Reply suggestion generation with target-language replies
- Selected reply saving
- Feedback flow
- Custom reply flow
- Regenerate flow
- Memory summary
- Risk Guard
- Verified profile grounding from config
- Inline callback actions for dynamic Telegram buttons
License not specified yet.