Skip to content
Rayyan Ahemad
← All projects
RAG agentShipped

LinkedIn HR Agent

An agent that writes branded LinkedIn posts grounded in a company's own documents.

Architecture

How it works

  1. PDF · DOCX · URL · Drive
  2. Extract + chunk
  3. Local embeddings → pgvector
  4. Claude tool use
  5. Branded image card
  6. Review → LinkedIn / Drive
A daily scheduler runs the agent automatically; agent memory stops it repeating recent topics.
  1. Build the knowledge base

    Files, web pages and Google Drive documents are extracted, split into 500-word chunks with 50-word overlap, embedded locally with bge-small and stored in PostgreSQL with pgvector.

  2. Pick a topic

    The agent chooses a service from the company catalog and checks its memory so it doesn't repeat a recent topic.

  3. Retrieve and write

    The closest chunks are found by cosine similarity. Claude Sonnet writes the post from that context and returns it through tool calls, so the output is structured.

  4. Make the image

    Claude Haiku writes an image prompt, DALL·E renders the visual, and Pillow composes a branded card with the headline and key points.

  5. Review and publish

    Drafts appear in a Next.js dashboard for review, then publish to LinkedIn through OAuth or save to Google Drive.

Information

An HR company wanted regular LinkedIn posts that stay accurate to its own services and documents, without someone writing each one by hand.

  • FastAPI
  • Claude API
  • pgvector
  • fastembed
  • Next.js
  • Docker Compose

Code on GitHub ↗