Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KinetiBlog

KinetiBlog turns a technical topic into a researched, structured Markdown article. It shows the LangGraph workflow in real time, including research, planning, parallel section drafting, image generation, and final assembly.

KinetiBlog interface

Demo video

Here is the demo video link.

How it works

  • Classifies each topic as closed-book, hybrid, or open-book.
  • Uses Tavily when the topic needs current sources.
  • Builds a structured article plan and drafts its sections in parallel.
  • Adds up to three useful technical visuals when they improve the article.
  • Streams every stage to the browser and provides the final Markdown as a download.

Architecture

flowchart LR
    UI["Browser UI<br/>HTML · CSS · JavaScript"]
    API["FastAPI<br/>app.py"]

    subgraph GRAPH["LangGraph workflow · backend.py"]
        ROUTER["Route topic"]
        RESEARCH["Research"]
        PLAN["Plan article"]
        WORKERS["Draft sections<br/>in parallel"]
        MERGE["Merge sections"]
        IMAGE_PLAN["Plan useful visuals"]
        IMAGE_GEN["Generate and place images"]

        ROUTER -->|current information needed| RESEARCH
        ROUTER -->|evergreen topic| PLAN
        RESEARCH --> PLAN
        PLAN --> WORKERS
        WORKERS --> MERGE
        MERGE --> IMAGE_PLAN
        IMAGE_PLAN --> IMAGE_GEN
    end

    UI -->|"POST /api/run<br/>SSE progress stream"| API
    API --> ROUTER
    IMAGE_GEN --> API
    API --> OUTPUT["outputs/&lt;run-id&gt;/blog.md"]

    TAVILY["Tavily Search"] -.-> RESEARCH
    OPENROUTER["OpenRouter LLM"] -.-> ROUTER
    OPENROUTER -.-> PLAN
    OPENROUTER -.-> WORKERS
    OPENROUTER -.-> IMAGE_PLAN
    GEMINI["Gemini image model"] -.-> IMAGE_GEN
    CHECKPOINTS[("PostgreSQL checkpoints<br/>MemorySaver fallback")] -.-> ROUTER
Loading

FastAPI serves the web interface and converts LangGraph updates into Server-Sent Events (SSE). The workflow uses PostgreSQL for checkpoints and falls back to in-memory checkpointing if the configured database cannot be reached.

Run locally

Requirements:

  • Python 3.14
  • uv
  • A PostgreSQL database and OpenRouter API key
  • Tavily and Google AI API keys for research and image generation

Create a .env file in the project root:

DATABASE_URL=postgresql://USER:PASSWORD@HOST:5432/DBNAME
OPENROUTER_API_KEY=your_openrouter_key
TAVILY_API_KEY=your_tavily_key
GOOGLE_API_KEY=your_google_ai_key

DATABASE_URL and OPENROUTER_API_KEY are required at startup. Tavily is used only when research is needed. If GOOGLE_API_KEY is unavailable, the article still completes with an image-generation failure note in place of a generated visual.

Install and start the application:

uv sync
uv run uvicorn app:app --reload

Open http://127.0.0.1:8000, enter a technical topic, and select Build article.

Project layout

Path Purpose
app.py FastAPI routes, SSE streaming, output storage, and downloads
backend.py LangGraph state, nodes, branching, parallel workers, and checkpointing
templates/index.html Web application markup
static/ Browser-side styles and workflow UI logic
images/ Visuals generated for articles
outputs/<run-id>/blog.md Downloadable Markdown generated for each run

License

Licensed under the Apache License 2.0.

About

generate well researched, image rich technical blog article in one click

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages