{"id":17355528,"url":"https://github.com/rithingithub/openagent","last_synced_at":"2025-03-27T14:50:21.421Z","repository":{"id":193834181,"uuid":"689580000","full_name":"Rithingithub/Openagent","owner":"Rithingithub","description":null,"archived":false,"fork":false,"pushed_at":"2023-09-10T09:49:02.000Z","size":6409,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T19:11:26.250Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rithingithub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-09-10T09:08:14.000Z","updated_at":"2024-02-29T09:54:37.000Z","dependencies_parsed_at":"2023-09-10T10:38:37.896Z","dependency_job_id":null,"html_url":"https://github.com/Rithingithub/Openagent","commit_stats":null,"previous_names":["rithingithub/test","rithingithub/openagent"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rithingithub%2FOpenagent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rithingithub%2FOpenagent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rithingithub%2FOpenagent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rithingithub%2FOpenagent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rithingithub","download_url":"https://codeload.github.com/Rithingithub/Openagent/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245866751,"owners_count":20685496,"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-15T17:43:37.619Z","updated_at":"2025-03-27T14:50:21.397Z","avatar_url":"https://github.com/Rithingithub.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e \n\u003cimg src=\"https://raw.githubusercontent.com/Tarikul-Islam-Anik/Animated-Fluent-Emojis/master/Emojis/Smilies/Grinning%20Face.png\" alt=\"Grinning Face\" width=\"50\" height=\"50\" /\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/Tarikul-Islam-Anik/Animated-Fluent-Emojis/master/Emojis/Smilies/Robot.png\" alt=\"Robot\" width=\"175\" height=\"175\" /\u003e\n\u003c/p\u003e\n\n*Hey there, Friend!\nThis project is still in the \u0026quot;just for friends\u0026quot; stage. If you want to see what we\u0026#39;re messing with and have some thoughts, take a look at the code.* \n\n*We'd love to incorporate your ideas or contributions. You can drop me a line at- ✉️  ` anurag@openagent.dev `*\n\n\u003ch1 id=\"-why-we-started-dotagent-\"\u003e\u003cstrong\u003eWhy we started dotagent?\u003c/strong\u003e\u003c/h1\u003e\n\n\u003cp\u003eWe have a dream: Open and democratic AGI , free from blackbox censorship and control imposed by private corporations under the disguise of alignment. We once had this with the web but lost this liberty to the corporate giants of the mobile era, whose duopoly has imposed a fixed 30% tax on all developers.\u003c/p\u003e\n\u003cp\u003eOur moonshot : A network of domain specific AI agents , collaborating so seamlessly that it feels like AGI. Contribute to democratizing the LAST technological frontier.\u003c/p\u003e\n\n![-----------------------------------------------------](https://github.com/dotagent-ai/openagent/blob/911fa336d5c5647ccbd45471f6bc5c2f22d1f45d/assets/divider.gif)\n\n\n\u003ch1 id=\"what-is-openagent-\"\u003eWhat is OpenAgent ?\u003c/h1\u003e\n\u003cp\u003eOpenAgent is a library of modular components and an orchestration framework. Inspired by a microservices approach, it gives developers all the components they need to build robust, stable \u0026amp; reliable AI applications and experimental autonomous agents.\u003c/p\u003e\n\n\n\n\u003ch2 id=\"modularity\"\u003e 🧱 Modularity\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003e\u003cem\u003e\u003cstrong\u003eMultiplatform:\u003c/strong\u003e\u003c/em\u003e Agents do not have to run on a single location or machine. Different components can run across various platforms, including the cloud, personal computers, or mobile devices.\u003c/li\u003e\n\u003cli\u003e\u003cem\u003e\u003cstrong\u003eExtensible:\u003c/strong\u003e\u003c/em\u003e If you know how to do something in Python or plain English, you can integrate it with OpenAgent.\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"guardrails\"\u003e 🚧 Guardrails\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003e\u003cem\u003e\u003cstrong\u003eSet clear boundaries:\u003c/strong\u003e\u003c/em\u003e Users can precisely outline what their agent can and cannot do. This safeguard guarantees that the agent remains a dynamic, self-improving system without overstepping defined boundaries.\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"greater-control-with-structured-outputs\"\u003e🏗️ Greater control with Structured outputs\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003e\u003cem\u003e\u003cstrong\u003eMore Effective Than Chaining or Prompting:\u003c/strong\u003e\u003c/em\u003e The prompt compiler unlocks the next level of prompt engineering, providing far greater control over LLMs than few-shot prompting or traditional chaining methods.\u003c/li\u003e\n\u003cli\u003e\u003cem\u003e\u003cstrong\u003eSuperpowers to Prompt Engineers:\u003c/strong\u003e\u003c/em\u003e It gives full power of prompt engineering, aligning with how LLMs actually process text. This understanding enables you to precisely control the output, defining the exact response structure and instructing LLMs on how to generate responses.\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"powerful-prompt-compiler\"\u003e🏭 Powerful Prompt Compiler\u003c/h2\u003e\n\u003cp\u003eThe philosophy is to handle more processing at compile time and maintain better session with LLMs.\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\u003cem\u003e\u003cstrong\u003ePre-compiling prompts:\u003c/strong\u003e\u003c/em\u003e By handling basic prompt processing at compile time, unnecessary redundant LLM processing are eliminated.\u003c/li\u003e\n\u003cli\u003e\u003cem\u003e\u003cstrong\u003eSession state with LLM:\u003c/strong\u003e\u003c/em\u003e Maintaining state with LLMs and reusing KV caches can eliminate many redundant generations and significantly speed up the process for longer and more complex prompts. \u003cem\u003e(only for opensource models)\u003c/em\u003e\u003c/li\u003e\n\u003cli\u003e\u003cem\u003e\u003cstrong\u003eOptimized tokens:\u003c/strong\u003e\u003c/em\u003e Compiler can transform many output tokens into prompt token batches, which are cheaper and faster. The structure of the template can dynamically guide the probabilities of subsequent tokens, ensuring alignment with the template and optimized tokenization . \u003cem\u003e\u003cstrong\u003e(only for opensource models)\u003c/strong\u003e\u003c/em\u003e\u003c/li\u003e\n\u003cli\u003e\u003cem\u003e\u003cstrong\u003e\u003cstrong\u003eSpeculative sampling (WIP):\u003c/strong\u003e\u003c/strong\u003e\u003c/em\u003e You can enhance token generation speed in a large language model by using a smaller model as an assistant. The method relies on an algorithm that generates multiple tokens per transformer call using a faster draft model. This can lead to upto 3x speedup in token generation .\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"-containerized-scalable-\"\u003e\u003cstrong\u003e📦 Containerized \u0026amp; Scalable\u003c/strong\u003e\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003e.🤖 \u003cem\u003e\u003cstrong\u003efiles :\u003c/strong\u003e\u003c/em\u003e Agents can be effortlessly exported into a simple .agent or .🤖 file, allowing them to run in any environment.\u003c/li\u003e\n\u003cli\u003e\u003cem\u003e\u003cstrong\u003eAgentbox (optional):\u003c/strong\u003e\u003c/em\u003e Agents should be able to optimize computing resources inside a sandbox. You can use Agentbox locally or on a cloud with a simple API, with cloud agentbox offering additional control and safety.\u003c/li\u003e\n\u003c/ul\u003e\n\n![-----------------------------------------------------](https://github.com/dotagent-ai/openagent/blob/911fa336d5c5647ccbd45471f6bc5c2f22d1f45d/assets/divider.gif)\n## Installation\n\n### Step 1: Install Poetry\n\nPoetry is used for dependency management in this project. Please note that Poetry has some compatibility issues with Conda.\n\n`pip install poetry` \n\n### Step 2: Lock the Dependencies\n\n\n`poetry lock` \n\n### Step 3: Install the Dependencies\n\n`poetry install` \n\n## Common Errors\n\n### SQLite3 Version Error\n\nIf you encounter an error like:\n\n\n\n`Your system has an unsupported version of sqlite3. Chroma requires sqlite3 \u003e= 3.35.0.` \n\nThis is a very common issue with Chroma DB. You can find instructions to resolve this in the [Chroma DB tutorial](https://docs.trychroma.com/troubleshooting#sqlite).\n\n### Code for a full-stack chat app, complete with UI.\n\n ```python\nimport openagent.compiler as compiler\nfrom openagent.compiler._program import Log\nfrom openagent import memory\nimport chainlit as ui\nfrom dotenv import load_dotenv\nload_dotenv()\n\n@ui.on_chat_start\ndef start_chat():\n    compiler.llm = compiler.llms.OpenAI(model=\"gpt-3.5-turbo\")\n\n\nclass ChatLog(Log):\n    def append(self, entry):\n        super().append(entry)\n        print(entry)\n        is_end = entry[\"type\"] == \"end\"\n        is_assistant = entry[\"name\"] == \"assistant\"\n        if is_end and is_assistant:\n            ui.run_sync(ui.Message(content=entry[\"new_prefix\"]).send())\n\n\nmemory = memory.SimpleMemory()\n\n@ui.on_message\nasync def main(message: str):\n    program = compiler(\n        \"\"\"\n        {{#system~}}\n        You are a helpful assistant\n        {{~/system}}\n\n        {{~#geneach 'conversation' stop=False}}\n        {{#user~}}\n        {{set 'this.user_text' (await 'user_text')  hidden=False}}\n        {{~/user}}\n\n        {{#assistant~}}\n        {{gen 'this.ai_text' temperature=0 max_tokens=300}}\n        {{~/assistant}}\n        {{~/geneach}}\"\"\", memory = memory\n    )\n\n    program(user_text=message, log=ChatLog())\n\n\n```\nThe UI will look something like this:\n![-----------------------------------------------------](./assets/chatapp.png)\n\n\n\n\u003chr\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frithingithub%2Fopenagent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frithingithub%2Fopenagent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frithingithub%2Fopenagent/lists"}