Pipeline AI che monitora LinkedIn per post rilevanti, li valuta rispetto al tuo profilo e consegna su Telegram suggerimenti di engagement ottimizzati per l'SSI — con bozze di commento pronte da incollare.

An AI-powered LinkedIn interaction bot that automatically discovers relevant posts, evaluates them against your professional profile, and delivers actionable engagement suggestions — complete with ready-to-paste comment drafts — directly to your Telegram chat.
It also serves as an SSI (Social Selling Index) optimizer: every suggestion is framed as a strategic engagement opportunity aligned to your personal brand.
index.js (pipeline entry point)
│
├── linkedin_scraper.js → Playwright scrape of your own profile + activity
│ (falls back to data/cv.md when no cookie is set)
│
├── search_engine.js → Playwright authenticated search OR Tavily API fallback
│ Returns: [{ title, url, content }]
│
├── triage_filter.js → Groq LLM (fast, cheap): boolean SI/NO relevance gate
│
├── ssi_analyzer.js → DeepSeek LLM (deep): SSI report + comment draft
│
├── seen_store.js → File-backed Set of processed URLs (data/seen_urls.json)
│
└── telegram_sender.js → Telegram Bot API wrapper (Markdown → HTML conversion)
bot.js (interactive Telegram bot, long-polling)
└── Dispatches /suggest → spawns index.js as a child process
Profile scrape
│
▼
Topic search (3 queries × 5 posts)
│
▼
Deduplicate by URL → filter seen URLs
│
▼
For each new post:
Triage (Groq) ──REJECTED──► skip, mark seen
│
APPROVED
│
▼
SSI Analysis (DeepSeek)
│
Score ≥ MIN_MATCH_SCORE?
│
YES
│
▼
Append to Telegram digest
Send batched digest → Telegram
npx playwright install chrome)npm install
npx playwright install chrome
Copy the example file and fill in your credentials:
cp .env.example .env
Open .env and set the following variables:
| Variable | Required | Description |
|---|---|---|
TELEGRAM_BOT_TOKEN |
Yes | Token from @BotFather |
TELEGRAM_CHAT_ID |
Yes | Your personal Telegram chat ID (use @userinfobot) |
GROQ_API_KEY |
Yes | API key from console.groq.com |
DEEPSEEK_API_KEY |
Yes | API key from platform.deepseek.com |
TAVILY_API_KEY |
No | Required only when LINKEDIN_LI_AT is not set |
LINKEDIN_LI_AT |
No | LinkedIn session cookie value (enables authenticated scraping) |
LINKEDIN_PROFILE_URL |
No | Your LinkedIn profile URL (required if LINKEDIN_LI_AT is set) |
TRIAGE_MODEL |
Yes | Groq model ID, e.g. llama3-8b-8192 |
ANALYSIS_MODEL |
Yes | DeepSeek model ID, e.g. deepseek-chat |
MIN_MATCH_SCORE |
No | Minimum relevance % to include a post (default: 70) |
LINKEDIN_LI_ATwww.linkedin.com.li_at cookie.Warning: Do not share your
li_atcookie. It grants full access to your LinkedIn session.
If you do not set LINKEDIN_LI_AT, place your professional profile as plain text or Markdown in data/cv.md. The pipeline will use this file instead of scraping LinkedIn.
| Command | Description |
|---|---|
npm start |
Run the full pipeline once and send the digest to Telegram. |
npm run bot |
Start the interactive Telegram bot (long-polling, runs until stopped). |
npm test |
Run the unit test suite with Vitest. |
Once the bot is running (npm run bot), send these commands from your Telegram account:
| Command | Description |
|---|---|
/suggest |
Trigger a full pipeline run. Results are sent to the same chat when complete. |
/profile |
Display the profile / CV currently loaded by the bot (truncated to 3000 chars). |
/status |
Report whether a pipeline run is currently in progress. |
Only messages from the configured TELEGRAM_CHAT_ID are accepted; all other senders are ignored.
.
├── index.js # Pipeline entry point
├── bot.js # Interactive Telegram bot
├── src/
│ ├── config.js # Environment variable loading
│ ├── linkedin_scraper.js # Playwright profile & activity scrapers
│ ├── search_engine.js # LinkedIn post search (Playwright + Tavily fallback)
│ ├── triage_filter.js # Groq-powered relevance gate
│ ├── ssi_analyzer.js # DeepSeek SSI strategy analyser
│ ├── seen_store.js # File-backed deduplication store
│ └── telegram_sender.js # Telegram Bot API wrapper
├── data/
│ ├── cv.md # (optional) Local profile fallback
│ └── seen_urls.json # Auto-generated; tracks processed posts
├── tests/ # Vitest unit tests
├── .env # Local credentials (never commit this)
├── .env.example # Template for required environment variables
└── package.json
npm test
Tests are written with Vitest and cover the triage filter, SSI analyser, seen store, and Telegram sender modules.
MIT