{"id":17601772,"url":"https://github.com/extensible-ai/dagent","last_synced_at":"2025-08-29T02:32:57.635Z","repository":{"id":242988297,"uuid":"808778873","full_name":"Extensible-AI/DAGent","owner":"Extensible-AI","description":"Build AI Agents with Your Existing Python Code!","archived":false,"fork":false,"pushed_at":"2024-10-26T14:55:40.000Z","size":383,"stargazers_count":56,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T19:10:00.284Z","etag":null,"topics":["agent","agents","ai","ai-agents","dag","framework","llama","llm","ollama","openai","python"],"latest_commit_sha":null,"homepage":"","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/Extensible-AI.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-31T19:53:12.000Z","updated_at":"2025-03-28T16:51:10.000Z","dependencies_parsed_at":"2024-06-21T16:16:03.506Z","dependency_job_id":"e84afcfd-29bd-479d-861d-0703a733e91e","html_url":"https://github.com/Extensible-AI/DAGent","commit_stats":null,"previous_names":["extensible-ai/dagent","parthsareen/dagent"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Extensible-AI/DAGent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Extensible-AI%2FDAGent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Extensible-AI%2FDAGent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Extensible-AI%2FDAGent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Extensible-AI%2FDAGent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Extensible-AI","download_url":"https://codeload.github.com/Extensible-AI/DAGent/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Extensible-AI%2FDAGent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272611921,"owners_count":24964385,"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","status":"online","status_checked_at":"2025-08-29T02:00:10.610Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["agent","agents","ai","ai-agents","dag","framework","llama","llm","ollama","openai","python"],"created_at":"2024-10-22T12:59:30.720Z","updated_at":"2025-08-29T02:32:57.603Z","avatar_url":"https://github.com/Extensible-AI.png","language":"Python","readme":"# DAGent - Directed Acyclic Graphs (DAGs) as AI Agents\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"DagentLogo.png\" alt=\"Dagent Logo\"\u003e\n\u003c/p\u003e\n\n*DAGent is an opinionated Python library to create AI Agents quickly without overhead*\n\n\n[![Downloads](https://static.pepy.tech/badge/dagent)](https://pepy.tech/project/dagent)\n\n## Quickstart\n\n### Installing \n- `pip install dagent` or `rye add dagent`\n- Make sure you have the API key of your choice available in system. The default is `OPENAI_API_KEY`\n\n\n### Get right into it \nSee [dagent/examples/quickstart_simple_agent.py](dagent/examples/quickstart_simple_agent.py) for a quickstart example \n\n\n### DAGent basics \n\nThe idea behind dagent is to structure AI agents in to a workflow. This is done through setting each function up as a node in a graph. \n\nThe agentic behavior is through the inferring of what function to run through the use of LLMs which is abstracted by a \"Decision Node\".\n\n`Tool`\n- A tool is just a function which the LLM can use. \n- It is helpful to have docstrings and annotations to assist the llm infer what is happening. This is recommended for larger functions/tools. \n\n`FunctionNode`\n- Runs a python function\n- Can be attached to a `DecisionNode` to be treated as a tool and allow an LLM to choose which function to run \n\n`DecisionNode`\n- This is where the llm picks a function to run from given options\n- The `.compile()` method autogenerates and saves tool descriptions under Tool. Run with param `force_load=True` if there are errors or if an option of tool changes\n- These tool/function descriptions get generated under a `Tool_JSON` folder. Feel free to edit tool descriptions if the agent is unreliable.\n\n`prev_output` param for functions:\n- If passing data from one function to another, make sure this param is in the function signature.\n- If extra params get passed in/weird stuff happens add a `**kwargs` to see if there are any hidden params which were passed and need to be handled\n\n\n### DAGent Diagram\n```mermaid\ngraph TD\n    A[Function Node] --\u003e B[Decision Node]\n    B --\u003e C[Function Node]\n    B --\u003e E[Function Node]\n    D --\u003e F[Function Node]\n    E --\u003e G[Decision Node]\n    F --\u003e H[Function Node]\n    G --\u003e K[Function Node]\n    G -- \"Pick Function to Run\" --\u003e I[Function Node]\n    G --\u003e J[Function Node]\n    I --\u003e L[Function Node]\n    J --\u003e M[Function Node]\n    K --\u003e N[Function Node]\n    K -- \"Run Both \" --\u003e S[Function Node]\n\n    %% Additional annotations\n    B -- \"Use a Function as a tool\" --\u003e D[Function Node]\n\n```\n\n## Using Different Models\n\nDAGent supports using different LLM models for inference and tool description generation. You can specify the model when calling `call_llm` or `call_llm_tool`, or when compiling the DecisionNode.\n\nFor example, to use the `groq/llama3-70b-8192` model:\n\n```python\n\n# Using groq with decision node\ndecision_node1 = DecisionNode('groq/llama3-70b-8192')\n\n# Using ollama with decision node\ndecision_node2 = DecisionNode('ollama_chat/llama3.1', api_base=\"http://localhost:11434\")\n\n# Call llm function\noutput = decision_node2.run(messages=[{'role': 'user', 'content': 'add the numbers 2 and 3'}])\n\n```\n\n### Other things to know\n\n- `prev_output` is needed in the function signature if you want to use the value from the prior function's value. Obviously the prior function should have returned something for this to work\n- If there are errors with too many params being passed into a function node, add `**kwargs` to your function \n- Args can be overriden at any time using the following (this merges the kwargs in the background with priority to the user):\n\n```python\nadd_two_nums_node.user_params = {\n    # param_name : value\n    a : 10\n}\n```\n\n## Feedback\n\nIf you are interested in providing feedback, please use [this form](https://docs.google.com/forms/d/14EHPUEYGVV-eNj6HyUaQYokHUtouYOeWfriwHaHOARE).\n\n## Acknowledgements \nShoutout to:\n- [@omkizzy](https://x.com/omkizzy)\n- [@kaelan](https://github.com/Oasixer)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fextensible-ai%2Fdagent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fextensible-ai%2Fdagent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fextensible-ai%2Fdagent/lists"}