{"id":25900502,"url":"https://github.com/jewis123/ai_code_arch_review","last_synced_at":"2026-06-10T05:31:42.482Z","repository":{"id":278738345,"uuid":"936610992","full_name":"jewis123/AI_Code_Arch_Review","owner":"jewis123","description":"This is an intelligent code architecture analysis system built on LangChain and LangGraph, designed for automated codebase structure analysis and architecture review recommendations.","archived":false,"fork":false,"pushed_at":"2025-02-24T09:43:40.000Z","size":239,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-03T02:16:57.949Z","etag":null,"topics":["aiworkflow","codearchreview","codereview","langchain","langgraph"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jewis123.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-21T11:35:34.000Z","updated_at":"2025-02-24T13:00:55.000Z","dependencies_parsed_at":"2025-02-21T12:33:20.316Z","dependency_job_id":"1200e904-944e-4131-af4e-9e0974e71ba7","html_url":"https://github.com/jewis123/AI_Code_Arch_Review","commit_stats":null,"previous_names":["jewis123/ai_code_arch_review"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jewis123%2FAI_Code_Arch_Review","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jewis123%2FAI_Code_Arch_Review/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jewis123%2FAI_Code_Arch_Review/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jewis123%2FAI_Code_Arch_Review/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jewis123","download_url":"https://codeload.github.com/jewis123/AI_Code_Arch_Review/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241596277,"owners_count":19988045,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aiworkflow","codearchreview","codereview","langchain","langgraph"],"created_at":"2025-03-03T02:17:00.329Z","updated_at":"2026-06-10T05:31:41.591Z","avatar_url":"https://github.com/jewis123.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# 代码架构分析系统\n\n基于LangChain和LangGraph构建的智能代码架构分析系统，用于自动化分析代码库结构并提供架构评审建议。\n\n## 功能特性\n\n- 代码结构分析：基于AST解析代码结构，提取类关系\n- 向量化存储：使用ChromaDB存储代码片段向量\n- UML图生成：自动生成Mermaid格式的UML类图\n- 多维度分析：从模块化、可扩展性等多个维度分析架构\n- 智能评审：基于LLM提供架构改进建议\n\n## 技术栈\n\n- LangChain: 构建LLM应用框架\n- LangGraph: 工作流编排\n- ChromaDB: 向量数据库\n- OpenAI/Gemini: 大语言模型接口\n- Tree-sitter: 代码解析\n\n## 核心模块\n\n### 代码分析器\n\u003cmcfile name=\"code_analyzer.py\" path=\"h:\\AI_WORK\\ai_review33\\agents\\code_analyzer.py\"\u003e\u003c/mcfile\u003e\n- 基于Tree-sitter解析代码AST\n- 使用LangChain的文本分割器处理代码片段\n- 通过LLM分析代码质量\n\n### Mermaid生成器\n\u003cmcfile name=\"mermaid_generator.py\" path=\"h:\\AI_WORK\\ai_review33\\agents\\mermaid_generator.py\"\u003e\u003c/mcfile\u003e\n- 从代码结构生成UML类图\n- 使用Mermaid语法描述类关系\n\n### 架构分析器\n\u003cmcfile name=\"framework_analyzer.py\" path=\"h:\\AI_WORK\\ai_review33\\agents\\framework_analyzer.py\"\u003e\u003c/mcfile\u003e\n- 多维度分析架构设计\n- 提供改进建议\n\n### 向量存储\n\u003cmcfile name=\"vector_store.py\" path=\"h:\\AI_WORK\\ai_review33\\vector_store.py\"\u003e\u003c/mcfile\u003e\n- 使用ChromaDB存储代码向量\n- 支持相似代码检索\n\n## 安装使用\n\n1. 安装依赖\n```bash\npip install -r requirements.txt\n```\n\n2. 配置环境变量\n- ARK_API_KEY: OpenAI API密钥\n- ARK_API_URL: API基础URL\n- GEMINI_API_KEY: Gemini API密钥\n\n3. 运行分析\n```bash\npython main.py\n```\n\n## 输出示例\n\n- UML类图：保存在 docs/uml_diagram.mmd\n- 架构分析报告：保存在 docs/framework_analyze.md\n- 代码异味分析：保存在 docs/smell_analyze.md\n\n## 项目结构\n\n```\n.\n├── agents/          # 分析代理模块\n├── docs/           # 分析结果文档\n├── extracts/       # 代码提取工具\n├── test/          # 测试用例\n├── core/          # 工作流、向量库\n├── main.py        # 主入口\n└── requirements.txt\n```\n\n## 依赖版本\n\n- langchain \u003e= 0.3.18\n- langgraph \u003e= 0.2.72\n- chromadb \u003e= 0.6.3\n- python-dotenv \u003e= 1.0.0\n\n## 注意事项\n\n1. 需要配置正确的API密钥才能使用\n2. 大型代码库分析可能需要较长时间\n3. 代码分析Agent是逐代码文件分析，耗时与token消耗和代码量成正比\n4. 实现方案经供参考，主要关键点已打通。\n5. 目前只实现了Csharp的Ast信息提取。\n\n\n## 许可证\n\nApache License 2.0\n\nCopyright (c) 2024 [奥格](https://github.com/jewis123)\n\n根据 Apache License 2.0 许可证的要求，在使用本项目时需要：\n\n1. 包含原始版权声明\n2. 包含 Apache License 2.0 许可证的副本\n3. 声明对原始代码的修改（如果有）\n4. 在衍生作品中保留作者署名信息\n\n完整许可证文本请参见：[Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjewis123%2Fai_code_arch_review","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjewis123%2Fai_code_arch_review","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjewis123%2Fai_code_arch_review/lists"}