codag  by michaelzixizhou

Visualize AI/LLM code workflows

Created 3 months ago
351 stars

Top 79.7% on SourcePulse

GitHubView on GitHub
Project Summary

Codag visualizes complex AI/LLM workflows directly within VSCode, transforming code analysis for AI engineers and agent builders. It automatically maps LLM API calls, decision branches, and processing steps across codebases, generating interactive graphs that link directly to source code, significantly reducing debugging time and simplifying onboarding onto intricate AI projects.

How It Works

Codag employs a multi-stage analysis pipeline. Tree-sitter parses code into ASTs across 10+ languages. Pattern matching detects LLM API calls and framework usage, followed by call graph extraction. A backend service leverages Gemini 2.5 Flash to semantically interpret structures, identifying workflow nodes, edges, and decision points. Live updates are enabled by incremental Tree-sitter re-parsing and AST diffing, reflecting code changes instantly without full LLM re-analysis. ELK and D3.js render interactive, theme-aware graphs.

Quick Start & Requirements

  • Installation: Requires a self-hosted backend and the VS Code extension.
    • Backend: Clone the repository, configure backend/.env.example with a Gemini API key, and run docker compose up -d. Alternatively, set up a Python 3.11 virtual environment and run python main.py.
    • Extension: Install "Codag" from the VS Code Marketplace.
  • Prerequisites: Gemini API key (free tier available).
  • Links: VS Code Marketplace.

Highlighted Details

  • Automatic Workflow Detection: Maps AI pipelines without manual configuration.
  • Live Graph Updates: Edits trigger instant graph changes via incremental parsing.
  • Click-to-Source Navigation: Nodes link directly to code locations.
  • Extensive Support: Integrates with numerous LLM providers (OpenAI, Gemini, etc.), frameworks (LangChain, LangGraph, etc.), AI services, and languages (Python, JS/TS, Go, Rust, C/C++, Java, Swift, Lua).
  • Export to PNG: Save workflow graphs as images.
  • Native Theme Support: Graphs match VS Code themes.

Maintenance & Community

The project welcomes Pull Requests. A roadmap includes a hosted backend and Git commit diff views. Contact is available via michael@codag.ai. No specific community channels (e.g., Discord/Slack) or notable contributors are listed.

Licensing & Compatibility

  • License: MIT.
  • Compatibility: The MIT license permits commercial use and integration with closed-source projects.

Limitations & Caveats

The project currently requires users to self-host the analysis backend and provide their own Gemini API key. Key features like a hosted backend and Git diff comparison are still on the roadmap. Adding support for new LLM providers or frameworks requires manual code contributions.

Health Check
Last Commit

1 week ago

Responsiveness

Inactive

Pull Requests (30d)
3
Issues (30d)
3
Star History
419 stars in the last 30 days

Explore Similar Projects

Starred by Boris Cherny Boris Cherny(Creator of Claude Code; MTS at Anthropic), Nat Friedman Nat Friedman(Former CEO of GitHub), and
41 more.

aider by Aider-AI

0.5%
41k
AI pair programming in your terminal
Created 2 years ago
Updated 5 days ago
Feedback? Help us improve.