{"id":13492316,"url":"https://github.com/emrgnt-cmplxty/automata","last_synced_at":"2025-03-28T10:32:05.176Z","repository":{"id":176402807,"uuid":"656278816","full_name":"emrgnt-cmplxty/automata","owner":"emrgnt-cmplxty","description":"Automata: A self-coding agent","archived":true,"fork":false,"pushed_at":"2023-09-05T21:24:32.000Z","size":203719,"stargazers_count":612,"open_issues_count":27,"forks_count":100,"subscribers_count":15,"default_branch":"full-automata","last_synced_at":"2024-10-31T06:34:56.019Z","etag":null,"topics":["agi","ai","autonomous-agents","autonomous-systems","gpt","gpt-4","llm","openai"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emrgnt-cmplxty.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-06-20T16:05:36.000Z","updated_at":"2024-10-23T00:29:42.000Z","dependencies_parsed_at":"2024-01-16T09:02:03.763Z","dependency_job_id":"a0177712-0950-4534-865c-18932aeb76f2","html_url":"https://github.com/emrgnt-cmplxty/automata","commit_stats":null,"previous_names":["emrgnt-cmplxty/automata"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emrgnt-cmplxty%2Fautomata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emrgnt-cmplxty%2Fautomata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emrgnt-cmplxty%2Fautomata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emrgnt-cmplxty%2Fautomata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emrgnt-cmplxty","download_url":"https://codeload.github.com/emrgnt-cmplxty/automata/tar.gz/refs/heads/full-automata","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246012538,"owners_count":20709464,"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":["agi","ai","autonomous-agents","autonomous-systems","gpt","gpt-4","llm","openai"],"created_at":"2024-07-31T19:01:04.926Z","updated_at":"2025-03-28T10:32:00.158Z","avatar_url":"https://github.com/emrgnt-cmplxty.png","language":"Python","funding_links":[],"categories":["Python","[Automata](https://github.com/emrgnt-cmplxty/automata)","Open-source Projects"],"sub_categories":["Links"],"readme":"# Automata: The Future is Self-Written\n\n[![codecov](https://codecov.io/github/emrgnt-cmplxty/Automata/branch/main/graph/badge.svg?token=ZNE7RDUJQD)](https://codecov.io/github/emrgnt-cmplxty/Automata)\n[![CodeFactor](https://www.codefactor.io/repository/github/emrgnt-cmplxty/automata/badge)](https://www.codefactor.io/repository/github/emrgnt-cmplxty/automata)\n  \u003ca href=\"https://github.com/emrgnt-cmplxty/automata/blob/main/LICENSE\" target=\"_blank\"\u003e\n      \u003cimg src=\"https://img.shields.io/static/v1?label=license\u0026message=Apache 2.0\u0026color=white\" alt=\"License\"\u003e\n  \u003c/a\u003e \n[![Documentation Status](https://readthedocs.org/projects/automata/badge/?version=latest)](https://automata.readthedocs.io/en/latest/?badge=latest)\n\n## Socials\n[![Discord](https://img.shields.io/discord/1120774652915105934?logo=discord)](https://discord.gg/j9GxfbxqAe)\n[![Twitter Follow](https://img.shields.io/twitter/follow/ocolegro?style=social)](https://twitter.com/ocolegro)\n[![GitHub star chart](https://img.shields.io/github/stars/emrgnt-cmplxty/Automata?style=social)](https://star-history.com/#emrgnt-cmplxty/Automata)\n\n\n\n### **Automata's objective is to evolve into a fully autonomous, self-programming Artificial Intelligence system**.\n\nAutomata is inspired by the theory that code is essentially a form of memory, and when furnished with the right tools, AI can evolve real-time capabilities which can potentially lead to the creation of AGI. The word automata comes from the Greek word αὐτόματος, denoting \"self-acting, self-willed, self-moving,\", and [Automata theory](https://en.wikipedia.org/wiki/Automata_theory) is the study of abstract machines and [automata](https://en.wikipedia.org/wiki/Automaton), as well as the computational problems that can be solved using them. \n\nMore information follows below.\n\n## Codespace\n[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/emrgnt-cmplxty/Automata)\n\n## Rough Schematic\n\n\u003cp align=\"center\"\u003e\n    \u003cimg width=\"971\" alt=\"Rough_Schematic_06_30_23_\" src=\"https://github.com/emrgnt-cmplxty/Automata/assets/68796651/f73f37ac-6335-4066-b9bc-79f9a2652cc1\"\u003e\n\u003c/p\u003e\n\n---\n\n## Demo\n\nhttps://github.com/emrgnt-cmplxty/Automata/assets/68796651/2e1ceb8c-ac93-432b-af42-c383ea7607d7\n\n\n## Installation and Usage\n\n### 🧠 [Stuck? Try the Docs](https://automata.readthedocs.io/en/latest/)\n\n### Initial Setup\n\nFollow these steps to setup the Automata environment\n\n```bash\n# Clone the repository\ngit clone git@github.com:emrgnt-cmplxty/Automata.git \u0026\u0026 cd Automata/\n\n# Initialize git submodules\ngit submodule update --init\n\n# Install poetry and the project\npip3 install poetry \u0026\u0026 poetry install\n\n# Configure the environment and setup files\npoetry run automata configure\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eInstallation via Docker\u003c/summary\u003e\n\u003cbr\u003e\nYou can also install Automata through Docker.\n\nPull the Docker image:\n```console\n$ docker pull ghcr.io/emrgnt-cmplxty/automata:latest\n```\n\nRun the Docker image:\n```console\n$ docker run --name automata_container -it --rm -e OPENAI_API_KEY=\u003cyour_openai_key\u003e -e GITHUB_API_KEY=\u003cyour_github_key\u003e ghcr.io/emrgnt-cmplxty/automata:latest\n```\n\nThis will start a Docker container with Automata installed and open an interactive shell for you to use.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eWindows Tips\u003c/summary\u003e\n\nWindows users may need to install C++ support through [Visual Studio's \"Desktop development with C++\"](https://visualstudio.microsoft.com/downloads/?q=build+tools) for certain dependencies.\n\nAdditionally, updating to gcc-11 and g++-11 may be required. This can be done by running the following commands:\n\n```bash\n# Adds the test toolchain repository, which contains newer versions of software\nsudo add-apt-repository ppa:ubuntu-toolchain-r/test\n\n# Updates the list of packages on your system\nsudo apt update\n\n# Installs gcc-11 and g++-11 packages\nsudo apt install gcc-11 g++-11\n\n# Sets gcc-11 and g++-11 as the default gcc and g++ versions for your system\nsudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 60 --slave /usr/bin/g++ g++ /usr/bin/g++-11\n```\n\n\u003c/details\u003e\n\n### Indexing\n\n[SCIP indices](https://about.sourcegraph.com/blog/announcing-scip) are required to run the Automata Search. These indices are used to create the code graph which relates symbols by dependencies across the codebase. New indices are generated and uploaded periodically for the Automata codebase, but programmers must be generate them manually if necessary for their local development. If you encounter issues, we recommend referring to the [instructions here](https://github.com/sourcegraph/scip-python).\n\n```bash\n# Install dependencies and run indexing on the local codebase\npoetry run automata install-indexing\n```\n\n### Build the embeddings + docs\n\n```\n# Refresh the code embeddings (after making local changes)\npoetry run automata run-code-embedding\n\n# Refresh the documentation + embeddings\npoetry run automata run-doc-embedding --embedding-level=2\n```\n\n\n### Run the system\n\nThe following commands illustrate how to run the system with a trivial instruction. It is recommended that your initial run is something of this sort to ensure the system is working as expected.\n\n```bash\n# Run a single agent w/ trivial instruction\npoetry run  automata run-agent --instructions=\"Return true\" --model=gpt-3.5-turbo-0613\n\n# Run a single agent w/ a non-trivial instruction\npoetry run automata run-agent --instructions=\"Explain what AutomataAgent is and how it works, include an example to initialize an instance of AutomataAgent.\"\n```\n\n---\n\n## Understanding Automata\n\nAutomata works by combining Large Language Models, such as GPT-4, with a vector database to form an integrated system capable of documenting, searching, and writing code. The procedure initiates with the generation of comprehensive documentation and code instances. This, coupled with search capabilities, forms the foundation for Automata's self-coding potential.\n\nAutomata employs downstream tooling to execute advanced coding tasks, continually building its expertise and autonomy. This self-coding approach mirrors an autonomous craftsman's work, where tools and techniques are consistently refined based on feedback and accumulated experience.\n\n### Example - Building your own agent\n\nSometimes the best way to understand a complicated system is to start by understanding a basic example. The following example illustrates how to run your own Automata agent. The agent will be initialized with a trivial instruction, and will then attempt to write code to fulfill the instruction. The agent will then return the result of its attempt.\n\n```python\n\nfrom automata.config.base import AgentConfigName, OpenAIAutomataAgentConfigBuilder\nfrom automata.agent import OpenAIAutomataAgent\nfrom automata.singletons.dependency_factory import dependency_factory\nfrom automata.singletons.py_module_loader import py_module_loader\nfrom automata.tools.factory import AgentToolFactory\n\n# Initialize the module loader to the local directory\npy_module_loader.initialize()\n\n# Construct the set of all dependencies that will be used to build the tools\ntoolkit_list = [\"context-oracle\"]\ntool_dependencies = dependency_factory.build_dependencies_for_tools(toolkit_list)\n\n# Build the tools\ntools = AgentToolFactory.build_tools(toolkit_list, **tool_dependencies)\n\n# Build the agent config\nagent_config = (\n    OpenAIAutomataAgentConfigBuilder.from_name(\"automata-main\")\n    .with_tools(tools)\n    .with_model(\"gpt-4\")\n    .build()\n)\n\n# Initialize and run the agent\ninstructions = \"Explain how embeddings are used by the codebase\"\nagent = OpenAIAutomataAgent(instructions, config=agent_config)\nresult = agent.run()\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to see the output\u003c/summary\u003e\n\nEmbeddings in this codebase are represented by classes such as `SymbolCodeEmbedding` and `SymbolDocEmbedding`. These classes store information about a symbol and its respective embeddings which are vectors representing the symbol in high-dimensional space.\n\nExamples of these classes are:\n`SymbolCodeEmbedding` a class used for storing embeddings related to the code of a symbol.\n`SymbolDocEmbedding` a class used for storing embeddings related to the documentation of a symbol.\n\nCode example for creating an instance of 'SymbolCodeEmbedding':\n\n```python\nimport numpy as np\nfrom automata.symbol_embedding.base import SymbolCodeEmbedding\nfrom automata.symbol.parser import parse_symbol\n\nsymbol_str = 'scip-python python automata 75482692a6fe30c72db516201a6f47d9fb4af065 `automata.agent.agent_enums`/ActionIndicator#'\nsymbol = parse_symbol(symbol_str)\nsource_code = 'symbol_source'\nvector = np.array([1, 0, 0, 0])\n\nembedding = SymbolCodeEmbedding(symbol=symbol, source_code=source_code, vector=vector)\n```\n\nCode example for creating an instance of 'SymbolDocEmbedding':\n\n```python\nfrom automata.symbol_embedding.base import SymbolDocEmbedding\nfrom automata.symbol.parser import parse_symbol\nimport numpy as np\n\nsymbol = parse_symbol('your_symbol_here')\ndocument = 'A document string containing information about the symbol.'\nvector = np.random.rand(10)\n\nsymbol_doc_embedding = SymbolDocEmbedding(symbol, document, vector)\n```\n\n\u003c/details\u003e\n\n## Contribution guidelines\n\n**If you want to contribute to Automata, be sure to review the\n[contribution guidelines](CONTRIBUTING.md). This project adheres to Automata's\n[code of conduct](CODE_OF_CONDUCT.md). By participating, you are expected to\nuphold this code.**\n\nWe use [GitHub issues](https://github.com/emrgnt-cmplxty/automata/issues) for\ntracking requests and bugs, please see\n[Automata Discussions](https://github.com/emrgnt-cmplxty/Automata/discussions/) for general questions and\ndiscussion, and please direct specific questions.\n\nThe Automata project strives to abide by generally accepted best practices in\nopen-source software development.\n\n## Future\n\nThe ultimate goal of the Automata project is to achieve a level of proficiency where it can independently design, write, test, and refine complex software systems. This includes the ability to understand and navigate large codebases, reason about software architecture, optimize performance, and even invent new algorithms or data structures when necessary.\n\nWhile the complete realization of this goal is likely to be a complex and long-term endeavor, each incremental step towards it not only has the potential to dramatically increase the productivity of human programmers, but also to shed light on fundamental questions in AI and computer science.\n\n## License\n\nAutomata is licensed under the Apache License 2.0.\n\n## Other\n\nThis project is an extension of an initial effort between [emrgnt-cmplxty](https://github.com/emrgnt-cmplxty) and [maks-ivanov](https://github.com/maks-ivanov) that began with this [repository](https://github.com/maks-ivanov/automata).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femrgnt-cmplxty%2Fautomata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femrgnt-cmplxty%2Fautomata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femrgnt-cmplxty%2Fautomata/lists"}