{"id":16185483,"url":"https://github.com/patrickhulce/mission-mech","last_synced_at":"2025-06-26T23:17:38.304Z","repository":{"id":174092782,"uuid":"646932868","full_name":"patrickhulce/mission-mech","owner":"patrickhulce","description":"A library to build mechanized assistants to accomplish vague missions using LLMs.","archived":false,"fork":false,"pushed_at":"2023-07-12T22:24:10.000Z","size":90,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-19T00:50:44.168Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/patrickhulce.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":"2023-05-29T17:14:17.000Z","updated_at":"2024-02-12T02:53:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"b20e55ef-2da9-4b2c-93c7-f9b0a879ccf8","html_url":"https://github.com/patrickhulce/mission-mech","commit_stats":{"total_commits":27,"total_committers":1,"mean_commits":27.0,"dds":0.0,"last_synced_commit":"5b128571d763f545058b0f43fffe273200026606"},"previous_names":["patrickhulce/mission-mech"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickhulce%2Fmission-mech","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickhulce%2Fmission-mech/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickhulce%2Fmission-mech/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickhulce%2Fmission-mech/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patrickhulce","download_url":"https://codeload.github.com/patrickhulce/mission-mech/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247657267,"owners_count":20974345,"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":[],"created_at":"2024-10-10T07:14:24.863Z","updated_at":"2025-04-07T13:15:35.755Z","avatar_url":"https://github.com/patrickhulce.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Autobots AI\n\nA collection of JavaScript libraries to build automated assistants to accomplish vague objectives using LLMs. Comparable to [LangChain](https://python.langchain.com/docs/get_started/introduction.html) but with no ecosystem, strong typing, an explicit focus on autonomous agents, and a Transformers™-inspired naming spin (not actually affiliated with Hasbro, Toei Animation, or Transformers in any way).\n\n## WTF did you build this?\n\nFun! LLMs are a relatively novel base building block of programming without dominant abstractions I thought it would be neat to explore. I also found the naming of \"chain\" in LangChain to irk me ever so slightly (when it's just a single INPUT-\u003eOUTPUT you haven't chained anything yet!), so I thought I'd have fun with it in a new way (I'm a sucker for themed libs).\n\nYou should almost definitely use LangChain instead of this though. What makes LangChain great is the enormous community of plugins, python as a dominant language for ML in general, and the plethora of eager-to-help expertise around it.\n\n## API\n\n### Simple Machines\n\nThe most basic machine is a passthrough of the prompt.\n\n```js\nimport {PromptMachine} from '@autobots-ai/core';\n\nconst model = new OpenAIChatCompletionModel({model: 'gpt-3.5-turbo'});\nconst machine = new PromptMachine({model});\nconst {output} = await machine.run(`What does AGI stand for?`);\nexpect(output).toContain('Artificial General Intelligence');\n```\n\n### Complex Machines\n\nWe can also link machines together in more complex ways.\n\n```js\nimport {PromptMachine, FanoutMachine, SequenceMachine} from '@autobots-ai/core';\nimport {WordpressMachine} from '@autobots-ai/wordpress';\n\n// Come up with many ideas.\nconst ideaMachine = new PromptMachine({\n  model,\n  template: ({topic}) =\u003e `Come up with 10 blog post ideas for ${topic} separated by newlines`,\n  parser: (output) =\u003e output.split('\\n'),\n});\n\n// Write a post for a given idea.\nconst writerMachine = new PromptMachine({\n  model,\n  template: ({topic}) =\u003e `Write a detailed blog post about ${topic}`,\n  parser: (output, {topic}) =\u003e ({title: topic, body: output}),\n});\n\n// Combine the two to write a post for each idea.\nconst postMachine = new FanoutMachine({model, source: ideaMachine, destination: writerMachine});\n\n// Publish a given post to WordPress.\nconst publisherMachine = new WordpressPostMachine({\n  origin: 'https://www.myblog.com',\n  username: process.env.WORDPRESS_USER,\n  password: process.env.WORDPRESS_PASS,\n  transform: ({title, body}) =\u003e ({title, body, author: 'Mr. Auto I. Bot', status: 'draft'}),\n});\n\n// Put it all together. Come up with ideas, write them, and then post them.\nconst bloggingMachine = new SequenceMachine({model, machines: [postMachine, publisherMachine]});\n\nawait bloggingMachine.run({topic: 'Transformers'});\n```\n\n### Autobots Assemble!\n\n```js\nimport {assemble} from '@autobots-ai/core';\nimport {BrowserMachine, FilesystemMachine} from '@autobots-ai/machines';\n\n// Autobots Assemble!\nconst downloaderBot = assemble()\n  // Supports browsing the internet.\n  .machine((context) =\u003e new BrowserMachine(context))\n  // Supports reading and writing to the filesystem.\n  .machine(\n    (context) =\u003e new FilesystemMachine({...context, scope: `${process.env.HOME}/Autobots/Sandbox`})\n  );\n\nconst mission = await downloaderBot.mobilize(`\n  Find the best 10 recent articles from diverse, high-quality sources about AGI and save them\n  in markdown to ~/Autobots/Sandbox/agi-articles in the format described in \"\"\" below.\n\n  \"\"\"\n  Title: TITLE_GOES_HERE\n  Link: LINK_GOES_HERE\n  Publisher: PUBLISHER_NAME_GOES_HERE\n  Author: AUTHORS_NAME_GOES_HERE\n  ---\n\n  ARTICLE_BODY_GOES_HERE\n  \"\"\"\n`);\n\nmission.on('step', (event) =\u003e console.log(event.input, event.output, event.machine));\nmission.on('progress', (event) =\u003e console.log(event.milestone));\n\nconst plan = await mission.plan();\nawait mission.completion({milestone: plan.milestones[1]});\nconsole.log('Achieved 2nd Milestone!');\nawait mission.completion();\nconsole.log('Done!');\n```\n\n## Concepts\n\n- Autobot: an autonomous agent capable of using machines and a brain to achieve an objective.\n  - Machine: a set of capabilities composed of a directed acyclic graph of cogs, optionally including a manual for use by an autobot.\n    - Manual: a description of a machine's inputs, outputs, and observations.\n    - Cog: a function that accepts input and produces output, a machine can itself may be a cog in another machine.\n  - Brain: a system capable of using machines in pursuit of an objective, typically using a model, collection of memories, and a strategy.\n    - Model: a construct (usually a large language model) that can make predictions based on prompts.\n    - Memory: a construct that retains knowledge from past prompts and their corresponding outputs.\n    - Strategy: a specific class of machine that accepts an objective and produces a plan with an algorithm (series of templates) for reducing / solving the objective.\n    - Template: a function with well-defined inputs that, when provided, produces a prompt.\n    - Prompt: a natural language string of instructions that can be used as input to a model.\n    - Objective: a natural language description of a desired state to pursue.\n\n### Machines\n\nMachines are to autobots as functions are to programming. They are fundamental, composable, and varied in scope. Machines are the basic building blocks of autobots and are extremely flexible.\n\nMachines with similar capabilities that satisfy a shared contract are grouped into types. `autobots-ai` provides several common machine types out-of-the-box.\n\n#### Converter Machines\n\nMachines that convert varied input formats into a text-based document.\n\nConverter machines share a common input intent (a reference to available information) and output format (a document).\n\nComing soon.\n\n#### Indexer Machines\n\nMachines that make varied input formats available in an index, usually paired with converter and retriever machines.\n\nIndexer machines share a common input intent (a reference to available information) and output intent (confirmation of storage).\n\nComing soon.\n\n#### Retrieval Machines\n\nMachines that retrieve information from an index. If the information sources are _not_ statically available, then they will be paired with an indexer machine. If the information sources _are_ statically defined, then they will not be paired with an indexer machine.\n\nRetrieval machines share a common input format (a natural language query of information) and output format (a list of relevant subdocuments).\n\nComing soon.\n\n### LangChain Comparisons\n\nModel -\u003e Model\nPrompt -\u003e Prompt\nMemory -\u003e Memory\nChain -\u003e Machine\nTool -\u003e Machine+Manual\nAgent -\u003e Strategy\nAgent Executor -\u003e Autobot\n\n## TODO\n\n- Everything ;)\n- Convert into turborepo (core, machines, sdk)\n- work through API example with podcast, conversion to text, indexing, and performing q\u0026a\n- add base implmenetations\n  - machines / templates / prompts / cogs\n  - manuals\n  - models\n  - memory\n  - strategy\n  - brain\n  - autobot\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickhulce%2Fmission-mech","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrickhulce%2Fmission-mech","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickhulce%2Fmission-mech/lists"}