AI engineer · 2026
LinkedIn Operator
A research-to-post pipeline that writes in my voice and never posts without me.
I built this to run my own LinkedIn. Every morning it reads nine technical feeds, picks angles from my approved project facts and voice guide, drafts two posts, audits them against my writing rules, refines what fails and waits for my approval before publishing through LinkedIn's official API.
What it does
- Research from nine allow-listed feeds: Hacker News AI, Hugging Face, LangChain, Ollama, PostgreSQL, FastAPI, Pydantic, pgvector and vLLM
- Two daily slots: a 900–1,300 character architecture lesson and a 500–900 character field note
- Five content pillars rotated across the week
- Structured drafts with hook, thesis, body, first comment, evidence, sources, poster prompt and diagram nodes
- Automatic architecture posters rendered locally with Pillow
- Local review UI to edit, approve, reject and publish
- Comment helper that proposes three replies for me to send by hand
- 17 CLI commands, from research and automate to publish and setup-check
How it works
- 01
ResearchAgent
Collects feeds with HTTPX and feedparser, canonicalises URLs, de-duplicates, scores technical relevance and drops unsafe topics. Deterministic.
- 02
AngleAgent
Picks a pillar and an angle from fresh research cards. Deterministic.
- 03
DraftAgent
Gemini writes one structured post from the research, my voice guide and an approved project registry. Pydantic validates the JSON.
- 04
SafetyAgent
Deterministic audit: length, hook, dashes, banned words, bait, hashtags, employer leaks, allowed sources and traceable numbers.
- 05
RefinerAgent
If the audit fails, Gemini repairs only the failing dimensions. Up to three rounds, re-audited every time.
- 06
Me
I review in the local UI. Approval re-runs the audit; editing resets approval; publishing needs eight gates.
Architecture
A voice guide and a public-claims registry are the only personal context sent to a model. Résumé and employer material stay local.
Direct Gemini REST with a fallback chain and retries on 408, 429 and 5xx; any OpenAI-compatible endpoint (OpenAI, Groq, Ollama); static templates when no key is set.
Markdown drafts with YAML front matter, JSON research sidecars and a JSONL comment inbox. No database.
LinkedIn OAuth with state validation, UserInfo lookup and the UGC Posts API. The returned post ID is written back to the draft.
FastAPI on loopback only, 10 routes, escaped HTML and path-traversal protection.
Engineering decisions
Evaluation is deterministic
No model grades a model. Every draft gets a pass or fail with errors and warnings; two drafts on the same day must have distinct theses, checked with a hashed similarity key.
Eight gates to publish
Approved status, no existing post ID, explicit confirmation, a live flag, an environment switch, a token, an access token and a resolvable member URN.
Nothing fake
No scraping, browser control, copied cookies, auto-likes, connection requests, DMs, comments or backdating.
Testing & evaluation
- 24 pytest tests in 6 files: audit rules, employer-leak policy, templates, approvals, dry runs, the Gemini client, the web UI and research freshness
- CI runs pytest and setup-check on every push and pull request
- A scheduled GitHub Action collects research daily at 08:00 IST and uploads the brief as an artifact; it never drafts or posts
Stack
Honest limits
Single-user and local by design. Scheduling is metadata; I publish by hand.