Dynamiq क्या है?
Dynamiq LLM agents और RAG workflows को orchestrate करने के लिए ओपन सोर्स Python framework. यह App Orchestration टूल्स की App Frameworks श्रेणी में आता है; ओपन सोर्स है, Python में लिखा गया है और Apache-2.0 लाइसेंस के तहत है। शुरू करने के लिए: dynamiq इंस्टॉल करें.
सारांश
Dynamiq एक ओपन सोर्स orchestration framework है, जो agentic AI और LLM applications के लिए बनाया गया है। यह Python में लिखा गया है और Apache 2.0 लाइसेंस के तहत जारी किया गया है। इसके README के अनुसार यह एक ऑल-इन-वन generative-AI framework है, जो retrieval-augmented generation (RAG) और LLM agents के orchestration में खास है।
Dynamiq में हर चीज़ एक node है: एक LLM call, एक agent, एक tool, एक document converter, एक splitter, एक embedder, एक vector-store writer या retriever। Nodes को एक Workflow में जोड़ा जाता है, जो उन्हें एक graph की तरह चलाता है। स्वतंत्र nodes parallel में चलते हैं, और जिन nodes में dependencies घोषित हैं वे क्रम से चलते हैं, साथ में एक input transformer होता है जो एक node के output को अगले node के input में बदल देता है।
Agents ReAct-style nodes होते हैं, जिनमें एक role, एक LLM, tools की सूची और एक loop limit होती है। चूंकि किसी agent को खुद भी tool के रूप में पास किया जा सकता है, इसलिए एक manager agent research और writing के sub-agents को काम सौंप सकता है। यही Workflow model RAG को भी कवर करता है: एक indexing flow जो PDFs को vector database में embeddings में बदलता है, और एक retrieval flow जो सवाल को embed करता है, top documents लाता है और उन्हीं से जवाब देता है। यह LangChain, LlamaIndex और Haystack जैसे frameworks का समकक्ष है, और इसके लिए Python 3.10 या उसके बाद का वर्जन चाहिए।
यह क्या करता है
- Workflow engine जो nodes को parallel या sequence में चलाता है, जिसमें स्पष्ट dependencies और nodes के बीच input transformers होते हैं
- ReAct agents, जिनमें roles, tool use, loop limits और asynchronous execution है; एक manager agent multi-agent orchestration के लिए agents को tools के रूप में इस्तेमाल कर सकता है
- E2B, Daytona और AWS Bedrock AgentCore Code Interpreter sandboxes पर आधारित code-execution tools
- RAG के building blocks: PDF converters, document splitters, embedders, और Pinecone जैसे vector stores के लिए writers और retrievers
- Jinja-style variables वाले prompt templates, साथ में chatbot memory और graph orchestrator, जिनमें से हर एक README examples में दिखाया गया है
- PyPI से dynamiq नाम से इंस्टॉल किया जा सकता है, या uv के साथ source से
शुरू करें
पैकेज इंस्टॉल करें, एक अकेला LLM node चलाएं, फिर Workflow में दो agents को जोड़ें। उदाहरण प्रोजेक्ट के README से लिए गए हैं और OpenAI इस्तेमाल करते हैं, इसलिए इनके लिए OpenAI API key चाहिए।
Dynamiq इंस्टॉल करें
Dynamiq को Python 3.10 या उसके बाद का वर्जन चाहिए। इसे PyPI से इंस्टॉल करें, या repository को clone करके uv से sync करें और source से build करें।
pip install dynamiq
# or build from source
git clone https://github.com/dynamiq-ai/dynamiq.git
cd dynamiq
uv syncएक सरल LLM flow चलाएं
एक LLM node को connection, एक model और एक prompt चाहिए। run() को कॉल करने पर input_data से template variables भरे जाते हैं।
from dynamiq.nodes.llms.openai import OpenAI
from dynamiq.connections import OpenAI as OpenAIConnection
from dynamiq.prompts import Prompt, Message
prompt_template = """
Translate the following text into English: {{ text }}
"""
prompt = Prompt(messages=[Message(content=prompt_template, role="user")])
llm = OpenAI(
id="openai",
connection=OpenAIConnection(api_key="OPENAI_API_KEY"),
model="gpt-4o",
temperature=0.3,
max_tokens=1000,
prompt=prompt
)
result = llm.run(
input_data={
"text": "Hola Mundo!"
}
)
print(result.output)Workflow में दो agents को chain करें
दूसरा agent पहले पर निर्भर है, और एक InputTransformer पहले agent का जवाब उसमें भेजता है। Workflow इन्हें क्रम से चलाता है, इसलिए आपको outputs को खुद एक-दूसरे तक नहीं पहुंचाना पड़ता।
from dynamiq import Workflow
from dynamiq.nodes.llms import OpenAI
from dynamiq.connections import OpenAI as OpenAIConnection
from dynamiq.nodes.agents import Agent
from dynamiq.nodes.node import InputTransformer, NodeDependency
llm = OpenAI(
connection=OpenAIConnection(api_key="OPENAI_API_KEY"),
model="gpt-4o",
temperature=0.1,
)
first_agent = Agent(
name="Expert Agent",
llm=llm,
role="Professional writer with the goal of producing well-written and informative responses.",
id="agent_1",
max_loops=5
)
second_agent = Agent(
name="Poetic Rewriter Agent",
llm=llm,
role="Professional writer with the goal of rewriting user input as a poem without changing its meaning.",
id="agent_2",
depends=[NodeDependency(first_agent)],
input_transformer=InputTransformer(
selector={"input": f"${[first_agent.id]}.output.content"}
),
max_loops=5
)
wf = Workflow()
wf.flow.add_nodes(first_agent)
wf.flow.add_nodes(second_agent)
result = wf.run(
input_data={"input": "How are sin(x) and cos(x) connected in electrodynamics?"},
)
print(result.output[second_agent.id].get("output").get("content"))आगे बढ़ें
README में multi-agent orchestration, Pinecone के साथ RAG indexing और retrieval, memory वाले chatbot और graph orchestrator के उदाहरण भी हैं। dynamiq-ai.github.io/dynamiq पर documentation में Quickstart, Agents और RAG tutorials तथा API reference मौजूद हैं।
कमांड और कोड प्रोजेक्ट के अपने दस्तावेज़ों से लिए गए हैं — हमेशा जांचें आधिकारिक repo ताज़ा जानकारी के लिए।
कब इस्तेमाल करें
- एक RAG service बनाएं जो PDFs को vector database में index करे और प्राप्त passages के आधार पर सवालों के जवाब दे
- एक manager agent चलाएं जो research और writing को विशेष sub-agents को सौंपे और परिणाम को जोड़े
- किसी agent को sandboxed code interpreter (E2B, Daytona या Bedrock AgentCore) दें, ताकि वह data और coding tasks हल कर सके
- कई LLM और agent steps को एक workflow में chain करें, जहां steps स्वतंत्र हों वहां parallel branches के साथ
How Dynamiq compares
Dynamiq alongside other open-source app frameworks tools AI/TLDR tracks, ranked by GitHub stars.
| टूल | स्टार | यह क्या करता है |
|---|---|---|
| LangChain | ★ 150k | आपस में जुड़ने वाले और बदले जा सकने वाले components से agents और LLM ऐप बनाएं |
| LlamaIndex | ★ 53.1k | रिट्रीवल और एजेंट्स के ज़रिए भाषा मॉडल को अपने डेटा से जोड़ें |
| Haystack | ★ 27.2k | प्रोडक्शन RAG पाइपलाइन और LLM एजेंट बनाने के लिए ओपन सोर्स Python फ़्रेमवर्क |
| Jina | ★ 21.9k | gRPC, HTTP और WebSockets पर संवाद करने वाली AI सर्विस बनाएं और चलाएं |
| RocketRide | ★ 19.9k | एक ओपन सोर्स, MIT लाइसेंस वाला AI मेटा-हार्नेस, जो C++ रनटाइम पर चलता है: VS Code, CLI, Python और TypeScript SDK, या इसके बिल्ट-इन MCP सर्वर से AI एजेंट और RAG पाइपलाइन बनाएं, टेस्ट करें और चलाएं |
| LLM | ★ 12.9k | कमांड लाइन से दर्जनों लैंग्वेज मॉडल इस्तेमाल करें, और हर एक को SQLite में लॉग करें |
| Prompt Flow | ★ 11.3k | लिंक्ड flows के साथ production-quality LLM ऐप्स बनाएँ, टेस्ट करें और शिप करें |
| Dynamiq | ★ 1.1k | LLM agents और RAG workflows को orchestrate करने के लिए ओपन सोर्स Python framework |
