需先运行 compile_container.py 生成 container.yaml 才能启动示例;运行前要设置 custom_openai_key 和 custom_openai_endpoint 环境变量;网页示例默认监听 127.0.0.1:7860。
OmAgent
om-ai-labApache-2.0活跃维护一个多模态语言 Agent 开发框架,把视觉模型和 LLM 编排在一起,帮你快速搭出能看能听的原型并推向生产。
[EMNLP-2024] Build multimodal language agents for fast prototype and production
pip install omagent-core
cd examples/step1_simpleVQA && python compile_container.py
python run_webpage.pyREADME 未说明具体显存或 GPU 型号要求;支持通过 Ollama 或 LocalAI 在本地部署自有模型。
轻量级 Python 库,快速搭建可处理图像、视频和音频的多模态语言智能体
一个多模态语言 Agent 开发框架,把视觉模型和 LLM 编排在一起,帮你快速搭出能看能听的原型并推向生产。
核心能力
- 用图结构工作流引擎编排智能体节点与任务
- 内置多种记忆类型支持上下文推理
- 原生支持 VLM 模型、实时 API 与移动端连接
- 提供 ReAct、CoT、SC-CoT 等现成智能体算法
- 支持 Lite 模式,无需部署中间件
容易踩的坑
- v0.2.4最新正式版2025-02-24 · 2025-02-24 08:16 UTC
What's Changed
- Feature: Add Lite Version Support for Local Workflow by @kyusonglee in https://github.com/om-ai-lab/OmAgent/pull/147
- add loop condition by @kyusonglee in https://github.com/om-ai-lab/OmAgent/pull/182
- Improve loop condition and lite version of cot by @kyusonglee in https://github.com/om-ai-lab/OmAgent/pull/183
- put transformers under init and make consistent start function for cli by @kyusonglee in https://github.com/om-ai-lab/OmAgent/pull/185
- Update CoT few_shot and make PoT lite version by @kyusonglee in https://github.com/om-ai-lab/OmAgent/pull/187
- Add GoT lite version and fix some loop exit by @kyusonglee in https://github.com/om-ai-lab/OmAgent/pull/188
- Add react and react pro lite version by @kyusonglee in https://github.com/om-ai-lab/OmAgent/pull/189
- Add the lite version of all agents by @kyusonglee in https://github.com/om-ai-lab/OmAgent/pull/190
- fix exit condition in loop by @xrc10 in https://github.com/om-ai-lab/OmAgent/pull/192
- Add fakeredis as a replacement for redis by @djwu563 in https://github.com/om-ai-lab/OmAgent/pull/198
- Develop/v0.2.4: video understanding support lite version, fix minor bugs in lite version by @XeonHis in https://github.com/om-ai-lab/OmAgent/pull/212
- Replace fakeredis with redislite by @djwu563 in https://github.com/om-ai-lab/OmAgent/pull/209
- Develop/v0.2.4: program exit bug fix by @XeonHis in https://github.com/om-ai-lab/OmAgent/pull/213
- Fix bug where worker lacked workflow_instance_id by @djwu563 in https://github.com/om-ai-lab/OmAgent/pull/215
- Fix bug where SharedMemSTM does not release memory after program exit by @djwu563 in https://github.com/om-ai-lab/OmAgent/pull/217
- Add caculator and code interpreter by @qiandl2000 in https://github.com/om-ai-lab/OmAgent/pull/216
- Fix bug in SharedMemSTM initialization by @djwu563 in https://github.com/om-ai-lab/OmAgent/pull/218
- Fix memory leak bug in SharedMemSTM by @djwu563 in https://github.com/om-ai-lab/OmAgent/pull/219
- Modified the code for react, react_pro, and general_self_consist_cot, and added reflexion. by @lijingcheng2021 in https://github.com/om-ai-lab/OmAgent/pull/211
- Add Tree of Thoughts (ToT) workflow example and core implementation by @fourfireM in https://github.com/om-ai-lab/OmAgent/pull/210
- General got for develop/v0.2.4 by @zhangqianqianhzlh in https://github.com/om-ai-lab/OmAgent/pull/214
- PoT update for v0.2.4 by @P3ngLiu in https://github.com/om-ai-lab/OmAgent/pull/220
- add RAP workflow and example by @xrc10 in https://github.com/om-ai-lab/OmAgent/pull/221
- add lite_client for webpage by @djwu563 in https://github.com/om-ai-lab/OmAgent/pull/222
- Develop/v0.2.4 by @panregedit in https://github.com/om-ai-lab/OmAgent/pull/223
- update main to v0.2.4 by @panregedit in https://github.com/om-ai-lab/OmAgent/pull/224
New Contributors
- @xrc10 made their first contribution in https://github.com/om-ai-lab/OmAgent/pull/192
- @qiandl2000 made their first contribution in https://github.com/om-ai-lab/OmAgent/pull/216
- @fourfireM made their first contribution in https://github.com/om-ai-lab/OmAgent/pull/210
- @zhangqianqianhzlh made their first contribution in https://github.com/om-ai-lab/OmAgent/pull/214
Full Changelog: https://github.com/om-ai-lab/OmAgent/compare/v0.2.3...v0.2.4
- v0.2.32025-01-26 · 2025-01-26 09:29 UTC
查看更新说明
What's Changed
- Feature/v0.2.3/support_llm_args_input by @panregedit in https://github.com/om-ai-lab/OmAgent/pull/184
- support local-ai for video_understanding by @yileld in https://github.com/om-ai-lab/OmAgent/pull/197
- Self consist cot workflow by @JulienZe in https://github.com/om-ai-lab/OmAgent/pull/193
- Feature/v0.2.3/PoT by @P3ngLiu in https://github.com/om-ai-lab/OmAgent/pull/199
- add video_understanding webpage example by @Silentharry94 in https://github.com/om-ai-lab/OmAgent/pull/201
- Develop/v0.2.3: LLM payload fix, update DnC operator by @XeonHis in https://github.com/om-ai-lab/OmAgent/pull/202
Full Changelog: https://github.com/om-ai-lab/OmAgent/compare/v0.2.2...v0.2.3
- v0.2.22025-01-14 · 2025-01-14 09:03 UTC
查看更新说明
What's Changed
- Add result returning to batch processing by @djwu563 in https://github.com/om-ai-lab/OmAgent/pull/142
- Add max_tasks to start_batch_processor in ProgrammaticClient by @djwu563 in https://github.com/om-ai-lab/OmAgent/pull/143
- Add custom tasks and integrate with the AaaS platform by @djwu563 in https://github.com/om-ai-lab/OmAgent/pull/145
- update docs by @djwu563 in https://github.com/om-ai-lab/OmAgent/pull/144
- Develop/v0.2.2: support passing variables in the prompt template through config file, update llm.md by @XeonHis in https://github.com/om-ai-lab/OmAgent/pull/149
- add Aaas device by @Silentharry94 in https://github.com/om-ai-lab/OmAgent/pull/151
- Update: Add inputs for DoWhileTask by @P3ngLiu in https://github.com/om-ai-lab/OmAgent/pull/152
- Add domain validation for Aaas by @djwu563 in https://github.com/om-ai-lab/OmAgent/pull/153
- Add worker.id to assign it to task_definition_name by @djwu563 in https://github.com/om-ai-lab/OmAgent/pull/154
- Feature/v0.2.2/prevent_module_duplication by @panregedit in https://github.com/om-ai-lab/OmAgent/pull/157
- Feature/v0.2.2/aaas by @Silentharry94 in https://github.com/om-ai-lab/OmAgent/pull/161
- opt Aaas message type and event value by @Silentharry94 in https://github.com/om-ai-lab/OmAgent/pull/164
- Update the "Quick Start" section in the README by @djwu563 in https://github.com/om-ai-lab/OmAgent/pull/166
- Add chatgpt parameter by @noname-zh in https://github.com/om-ai-lab/OmAgent/pull/165
- Develop/v0.2.2: update tavily search doc, fix minor bug in video understanding stage by @XeonHis in https://github.com/om-ai-lab/OmAgent/pull/158
- add ollama doc by @yileld in https://github.com/om-ai-lab/OmAgent/pull/171
- Feature/v0.2.2/PoT by @P3ngLiu in https://github.com/om-ai-lab/OmAgent/pull/160
- add CoT operator and example by @KingSan666888 in https://github.com/om-ai-lab/OmAgent/pull/150
- Self consist cot workflow by @JulienZe in https://github.com/om-ai-lab/OmAgent/pull/159
- add React and React_pro by @lijingcheng2021 in https://github.com/om-ai-lab/OmAgent/pull/169
- opt workflow_instance_id type add task execute timeout by @Silentharry94 in https://github.com/om-ai-lab/OmAgent/pull/170
- Develop/v0.2.2: Support token usage of each running, isolated by workflow_instance_id by @XeonHis in https://github.com/om-ai-lab/OmAgent/pull/172
- opt func_timeout by @Silentharry94 in https://github.com/om-ai-lab/OmAgent/pull/174
- readme add input and output by @JulienZe in https://github.com/om-ai-lab/OmAgent/pull/176
- improve the code execution by @P3ngLiu in https://github.com/om-ai-lab/OmAgent/pull/177
- Refactor: Remove init method and rewrite search functionality for improved modularity by @lijingcheng2021 in https://github.com/om-ai-lab/OmAgent/pull/180
- Add support for setting a domain for workers by @djwu563 in https://github.com/om-ai-lab/OmAgent/pull/179
- opt conversation_info by @Silentharry94 in https://github.com/om-ai-lab/OmAgent/pull/178
New Contributors
- @noname-zh made their first contribution in https://github.com/om-ai-lab/OmAgent/pull/165
- @yileld made their first contribution in https://github.com/om-ai-lab/OmAgent/pull/171
- @JulienZe made their first contribution in https://github.com/om-ai-lab/OmAgent/pull/159
- @lijingcheng2021 made their first contribution in https://github.com/om-ai-lab/OmAgent/pull/169
Full Changelog: https://github.com/om-ai-lab/OmAgent/compare/v0.2.1...v0.2.2
- v0.2.12024-12-25 · 2024-12-25 06:44 UTC
查看更新说明
- New debug mode, features include:
- More detailed log information
- Stops all running instances of the same workflow when a workflow is started
- Disables error retries
- New Tavily search tool
- New device:
- WebpageClient provides a Gradio-based web UI
- ProgrammaticClient offers a concise programming interface, allowing you to call workflows as Python functions
- Use the conductor's logging system instead of the local logging system.
- New in-memory STM, enabling STM functionality without relying on external components
- Optimized large language model invocation methods, especially for multimodal invocation.
- Optimized app backend code
- New debug mode, features include:
- v0.2.02024-12-04 · 2024-12-04 11:23 UTC
查看更新说明
What's Changed
- refactor the framework by @panregedit in https://github.com/om-ai-lab/OmAgent/pull/26
- Refactor Request Handling and Enhance Error Logging in
general.pyby @Mefisto04 in https://github.com/om-ai-lab/OmAgent/pull/28 - Add rescue node by @panregedit in https://github.com/om-ai-lab/OmAgent/pull/29
- fix import error by @panregedit in https://github.com/om-ai-lab/OmAgent/pull/30
- Feature/v0.2.0/conductor by @panregedit in https://github.com/om-ai-lab/OmAgent/pull/34
- add redis stream listener and app callback by @djwu563 in https://github.com/om-ai-lab/OmAgent/pull/36
- Refactor STM and fix errors by @P3ngLiu in https://github.com/om-ai-lab/OmAgent/pull/37
- Feature/v0.2.0/app_client by @panregedit in https://github.com/om-ai-lab/OmAgent/pull/38
- Dev/v0.2.0 by @panregedit in https://github.com/om-ai-lab/OmAgent/pull/39
- Add MilvusLTM: LTM with Milvus Vector DB by @kyusonglee in https://github.com/om-ai-lab/OmAgent/pull/40
- Bugfix: fix forktask compile error by @XeonHis in https://github.com/om-ai-lab/OmAgent/pull/41
- fix stm_redis bug, change decode_responses=False to RedisConnector by @P3ngLiu in https://github.com/om-ai-lab/OmAgent/pull/43
- Feature/v0.2.0/opt_container by @panregedit in https://github.com/om-ai-lab/OmAgent/pull/45
- fix app client input and callback bug by @djwu563 in https://github.com/om-ai-lab/OmAgent/pull/44
- Feature/v0.2.0/build_worker by @panregedit in https://github.com/om-ai-lab/OmAgent/pull/46
- Hotfix/v0.2.0/container_wrong_input by @panregedit in https://github.com/om-ai-lab/OmAgent/pull/47
- fix input and callback bug by @djwu563 in https://github.com/om-ai-lab/OmAgent/pull/48
- Optimize the client module and remove unnecessary packages by @djwu563 in https://github.com/om-ai-lab/OmAgent/pull/49
- Hotfix/v0.2.0/container_load by @panregedit in https://github.com/om-ai-lab/OmAgent/pull/50
- Feature/v0.2.0/worker_supports_setting_concurrency by @panregedit in https://github.com/om-ai-lab/OmAgent/pull/51
- Feature/v0.2.0/DnC: refactor Divide-and-Conquer feature to conductor compatible implementation by @XeonHis in https://github.com/om-ai-lab/OmAgent/pull/52
- Feature/v0.2.0/share_workflowId by @panregedit in https://github.com/om-ai-lab/OmAgent/pull/53
- Feature/v0.2.0/opt_container_compile by @panregedit in https://github.com/om-ai-lab/OmAgent/pull/54
- update ltm and stm, fix bug by @P3ngLiu in https://github.com/om-ai-lab/OmAgent/pull/56
- Feature/v0.2.0/dict_stm by @panregedit in https://github.com/om-ai-lab/OmAgent/pull/57
- Add support for multi-line input to DefaultClient and enable the clie… by @djwu563 in https://github.com/om-ai-lab/OmAgent/pull/58
- Feature/v0.2.0/opt_conductor_config by @panregedit in https://github.com/om-ai-lab/OmAgent/pull/59
- Hotfix/v0.2.0/merge_compile_container by @panregedit in https://github.com/om-ai-lab/OmAgent/pull/60
- Hotfix/v0.2.0/conductor_config by @panregedit in https://github.com/om-ai-lab/OmAgent/pull/61
- Feature/v0.2.0/DnC: refactor AgentTask, callback function update, compatible with new stm and conductor configurations by @XeonHis in https://github.com/om-ai-lab/OmAgent/pull/62
- add examples step1_simpleVQA by @P3ngLiu in https://github.com/om-ai-lab/OmAgent/pull/63
- Fix the bug in the CLI input and adjust the code in run.py by @djwu563 in https://github.com/om-ai-lab/OmAgent/pull/64
- Feature/v0.2.0/DnC: Be compatible with new run_app and run_cli entrypoint by @XeonHis in https://github.com/om-ai-lab/OmAgent/pull/65
- Feature/v0.2.0/opt_client_import by @panregedit in https://github.com/om-ai-lab/OmAgent/pull/66
- add examples by @P3ngLiu in https://github.com/om-ai-lab/OmAgent/pull/67
- Bug fix: reset redis_stream_client password to default, fix register stm error by @XeonHis in https://github.com/om-ai-lab/OmAgent/pull/68
- Bug fix: reset redis_stream_client password to default, fix register stm error by @XeonHis in https://github.com/om-ai-lab/OmAgent/pull/69
- update readme f
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
📖 Introduction
OmAgent is python library for building multimodal language agents with ease. We try to keep the library simple without too much overhead like other agent framework.
- We wrap the complex engineering (worker orchestration, task queue, node optimization, etc.) behind the scene and only leave you with a super-easy-to-use interface to define your agent.
- We further enable useful abstractions for reusable agent components, so you can build complex agents aggregating from those basic components.
- We also provides features required for multimodal agents, such as native support for VLM models, video processing, and mobile device connection to make it easy for developers and researchers building agents that can reason over not only text, but image, video and audio inputs.
🔑 Key Features
- A flexible agent architecture that provides graph-based workflow orchestration engine and various memory type enabling contextual reasoning.
- Native multimodal interaction support include VLM models, real-time API, computer vision models, mobile connection and etc.
- A suite of state-of-the-art unimodal and multimodal agent algorithms that goes beyond simple LLM reasoning, e.g. ReAct, CoT, SC-Cot etc.
- Supports local deployment of models. You can deploy your own models locally by using OllamaOllama or LocalAI.
- Fully distributed architecture, supports custom scaling. Also supports Lite mode, eliminating the need for middleware deployment.
🛠️ How To Install
- python >= 3.10
- Install omagent_core
Use pip to install omagent_core latest release.
Or install the latest version from the source code like below.pip install omagent-corepip install -e omagent-core
🚀 Quick Start
Configuration
The container.yaml file is a configuration file that manages dependencies and settings for different components of the system. To set up your configuration:
-
Generate the container.yaml file:
cd examples/step1_simpleVQA python compile_container.pyThis will create a container.yaml file with default settings under
examples/step1_simpleVQA. For more information about the container.yaml configuration, please refer to the container module -
Configure your LLM settings in
configs/llms/gpt.yml:- Set your OpenAI API key or compatible endpoint through environment variable or by directly modifying the yml file
export custom_openai_key="your_openai_api_key" export custom_openai_endpoint="your_openai_endpoint"You can use a locally deployed Ollama to call your own language model. The tutorial is here.
Run the demo
-
Run the simple VQA demo with webpage GUI:
For WebpageClient usage: Input and output are in the webpage
cd examples/step1_simpleVQA python run_webpage.pyOpen the webpage at
http://127.0.0.1:7860, you will see the following interface:
🤖 Example Projects
1. Video QA Agents
Build a system that can answer any questions about uploaded videos with video understanding agents. we provide a gradio based application, see details here.
More about the video understanding agent can be found in paper.
2. Mobile Personal Assistant
Build your personal mulitmodal assistant just like Google Astral in 2 minutes. See Details here.
3. Agentic Operators
We define reusable agentic workflows, e.g. CoT, ReAct, and etc as agent operators. This project compares various recently proposed reasoning agent operators with the same LLM choice and test datasets. How do they perform? See details here.
| Algorithm | LLM | Average | gsm8k-score | gsm8k-cost($) | AQuA-score | AQuA-cost($) |
|---|---|---|---|---|---|---|
| SC-COT | gpt-3.5-turbo | 73.69 | 80.06 | 5.0227 | 67.32 | 0.6491 |
| COT | gpt-3.5-turbo | 69.86 | 78.70 | 0.6788 | 61.02 | 0.0957 |
| ReAct-Pro | gpt-3.5-turbo | 69.74 | 74.91 | 3.4633 | 64.57 | 0.4928 |
| POT | gpt-3.5-turbo | 64.42 | 76.88 | 0.6902 | 51.97 | 0.1557 |
| IO* | gpt-3.5-turbo | 38.40 | 37.83 | 0.3328 | 38.98 | 0.0380 |
*IO: Input-Output Direct Prompting (Baseline)
More Details in our new repo open-agent-leaderboard and Hugging Face space
💻 Documentation
More detailed documentation is available here.
🤝 Contributing
For more information on how to contribute, see here.
We value and appreciate the contributions of our community. Special thanks to our contributors for helping us improve OmAgent.
🔔 Follow us
You can follow us on X, Discord and WeChat group for more updates and discussions.
🔗 Related works
If you are intrigued by multimodal large language models, and agent technologies, we invite you to delve deeper into our research endeavors:
🔆 How to Evaluate the Generalization of Detection? A Benchmark for Comprehensive Open-Vocabulary Detection (AAAI24)
🏠 GitHub Repository
🔆 OmDet: Large-scale vision-language multi-dataset pre-training with multimodal detection network (IET Computer Vision)
🏠 Github Repository
⭐️ Citation
If you find our repository beneficial, please cite our paper:
@article{zhang2024omagent,
title={OmAgent: A Multi-modal Agent Framework for Complex Video Understanding with Task Divide-and-Conquer},
author={Zhang, Lu and Zhao, Tiancheng and Ying, Heting and Ma, Yibo and Lee, Kyusong},
journal={arXiv preprint arXiv:2406.16620},
year={2024}
}