{"id":15021381,"url":"https://github.com/cameronking4/annotated-ast-for-llm","last_synced_at":"2025-10-28T16:31:25.714Z","repository":{"id":236424633,"uuid":"792586624","full_name":"cameronking4/Annotated-AST-For-LLM","owner":"cameronking4","description":"Annotated AST for the purposes of LLM code repository context. Use this novel approach to pre-process your Github repository. This project will generate an AST.json file which will contextually represent the repo for you to share as a single file to LLM directly or Vector Store","archived":false,"fork":false,"pushed_at":"2024-12-13T04:55:34.000Z","size":399,"stargazers_count":22,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-01T16:36:00.331Z","etag":null,"topics":["abstract-syntax-tree","abstraction","ai","ast","babel","coding","context","github","llm","openai","parsers","software"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/cameronking4.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":"2024-04-27T02:04:47.000Z","updated_at":"2025-01-11T20:59:55.000Z","dependencies_parsed_at":"2024-07-18T12:30:23.008Z","dependency_job_id":"e62f72f0-8d4c-41f5-a3e0-c3c5eb0f41b8","html_url":"https://github.com/cameronking4/Annotated-AST-For-LLM","commit_stats":{"total_commits":10,"total_committers":2,"mean_commits":5.0,"dds":"0.30000000000000004","last_synced_commit":"a98b75c842ffb395a9ac9869772336f4e0aa7003"},"previous_names":["cameronking4/ast-for-llm","cameronking4/annotated-ast-for-llm"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cameronking4%2FAnnotated-AST-For-LLM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cameronking4%2FAnnotated-AST-For-LLM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cameronking4%2FAnnotated-AST-For-LLM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cameronking4%2FAnnotated-AST-For-LLM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cameronking4","download_url":"https://codeload.github.com/cameronking4/Annotated-AST-For-LLM/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238680796,"owners_count":19512642,"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":["abstract-syntax-tree","abstraction","ai","ast","babel","coding","context","github","llm","openai","parsers","software"],"created_at":"2024-09-24T19:56:31.047Z","updated_at":"2025-10-28T16:31:20.342Z","avatar_url":"https://github.com/cameronking4.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Greptile Clone: An Annotated AST for the purposes of providing LLM full context of code repository in single file\nAchieve the functionality of Greptile by supplying ChatGPT with a generated AST file that represents your Github Repo for context. Use in a single chat or within a GPT or assistant, Vector store etc. Note the different branches.\n\n## Try POC\nUse `main` branch if you're looking to generate an AI annotated AST for a local repository. Switch to `from-github` branch if you want to process an array of github repositories. \n\n`yarn install`\n\n`node index.js`\n\nIf you're looking for an API or something to use in production, here is the latest implementation you can deploy to DigitalOcean or any other CSP that supports long standing operations: [GreptileClone](https://github.com/cameronking4/GreptileClone)\n\n\n\n## Overview\nThis document outlines the structure and script to generate a custom Abstract Syntax Tree (AST) for a given JavaScript / Typescript repository - for the purposes of sharing repo context with LLM. This custom AST provides a detailed representation of the files, their dependencies, and metadata, which is crucial for analysis and manipulation of the codebase for the purposes of Langchain Agent / OpenAI assistant vector memory. This is a scalable approach for sharing repo knowledge for an LLM as a single JSON file to light up \"chat with Github\" scenarios quickly.\n\n## Novel AST Structure\nUsing this method will structure your repo in a nested JSON format, where each node represents a file or a module with its specific properties:\n\n- **file**: The path to the file or module.\n- **type**: The type of the file (e.g., JSON, JavaScript).\n- **ast**: A recursive breakdown of the file’s contents, including metadata such as versions, dependencies, and other relevant details.\n- **summary**: An AI generated summary of the file, the annotation!\n- **sourceCode**: The source code itself for the file. (Optional)\n\n## Usage\n### Analysis\nThis can be uses a pre-processing step for exposing your source code and giving an LLM the full context of how your repo works. [Learn more]()\n\n### Tool Integration\nThe AST can be integrated with tools for:\n- **Static analysis**: Analyze code quality, security vulnerabilities, and coding standards compliance.\n- **Dependency management**: Tools that automate dependency upgrades, ensuring that all dependencies are up to date and secure.\n- **Custom scripts**: Write scripts that traverse the AST to automate specific tasks such as refactoring or identifying unused code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcameronking4%2Fannotated-ast-for-llm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcameronking4%2Fannotated-ast-for-llm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcameronking4%2Fannotated-ast-for-llm/lists"}