-
Notifications
You must be signed in to change notification settings - Fork 78
[WIP] Removed Several Abstractions and Enabled Lighter Durable Agents and Orchestrators #240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Roberto Rodriguez <[email protected]>
Signed-off-by: Roberto Rodriguez <[email protected]>
Signed-off-by: Roberto Rodriguez <[email protected]>
…s abstractions Signed-off-by: Roberto Rodriguez <[email protected]>
…tors Signed-off-by: Roberto Rodriguez <[email protected]>
…rs to Host Workflow Execution Signed-off-by: Roberto Rodriguez <[email protected]>
Signed-off-by: Roberto Rodriguez <[email protected]>
… quickstarts to test Agents Signed-off-by: Roberto Rodriguez <[email protected]>
Signed-off-by: Roberto Rodriguez <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall really liking where this is going 🙌 - few comments so far high level for ya :) any chance you could add some tests?
| - appID: LLMOrchestratorApp | ||
| appDirPath: ./services/workflow-llm/ | ||
| command: ["python3", "app.py"] | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| appLogDestination: console | ||
| daprdLogDestination: console | ||
|
|
||
| apps: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add gandalf? shall we just combine this quickstart with the 05 one instead of adding a new quickstart?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I was just trying to keep it separate to not mess with the other ones for now 😅.
| appLogDestination: console | ||
| daprdLogDestination: console | ||
|
|
||
| apps: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add gandalf?
| profile_config=frodo_profile, | ||
| pubsub_config=frodo_pubsub, | ||
| state_config=frodo_state, | ||
| registry_config=registry_config, | ||
| memory_config=frodo_memory, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we need the _config suffixes here on the field names
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh you mean on the attributes of the class? I was thinking about the same thing too. What do you think? I think it would be cleaner ;) I am fine with renaming those without the suffix.
| "Emphasize practicality over poetry.", | ||
| "Stay loyal and supportive, especially under pressure.", | ||
| ], | ||
| modules=("supplies", "campcraft"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oooooo - what are modules for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was testing this. I implemented it, but forgot to add more documentation :( . Modules are a plugin/extensibility system for dynamically adding prompt sections to agents. They work through a registry pattern that allows you to compose agent prompts from reusable, configurable components.
How Modules Work
The modules system has three key components:
PROMPT_MODULE_REGISTRY- A global dictionary mapping module names to factory functionsregister_prompt_module()- Function to register new modules globally- Module resolution logic - Processes modules when building agent prompts
When an agent is created with modules, the system:
- Checks if there's a
module_overridefor that module name - If not, looks up the factory function in the registry
- Calls the factory to generate a
PromptSection - Injects these sections into the agent's system prompt
Current State: Fully Implemented
PromptSectionis defined indapr_agents/agents/configs.pyAgentProfileConfighas bothmodulesandmodule_overridesfields- The processing logic in
prompting.pyhandles module resolution
Usage Example
Here's how to use modules in your agent configuration:
from dapr_agents.agents.configs import (
AgentProfileConfig,
PromptSection, # Add this import
)
sam_profile = AgentProfileConfig(
name="Samwise Gamgee",
role="Logistics, Provisions & Morale",
goal="Keep the party supplied, rested, and on schedule...",
instructions=[
"Track food, water, camp gear, and rest cadence; flag shortages early.",
# ... more instructions
],
style_guidelines=[
"Warm, plain-spoken, and grounded.",
# ... more guidelines
],
# Declare which modules you want
modules=("supplies", "campcraft"),
# Provide inline implementations (no global registration needed)
module_overrides={
"supplies": PromptSection(
title="Supply Management",
lines=[
"Track current inventory of food, water, and camp gear.",
"Monitor daily consumption rates and estimate days remaining.",
"Flag low supplies before they become critical (2-day threshold).",
"Suggest resupply opportunities at settlements or natural resources.",
]
),
"campcraft": PromptSection(
title="Campsite Selection Protocol",
lines=[
"Evaluate proximity to water (within 100m), natural concealment, and defensibility.",
"Consider current weather conditions and terrain protection.",
"Identify at least two emergency escape routes from the camp location.",
"Balance safety requirements with rest quality and party morale needs.",
]
),
}
)Without modules, Sam's system prompt contains:
- Name: "Samwise Gamgee"
- Role: "Logistics, Provisions & Morale"
- Goal: (goal text)
- Primary Instructions: (instruction list)
- Communication Style: (style guidelines)
With the modules above, Sam's system prompt gets additional sections:
Supply Management:
- Track current inventory of food, water, and camp gear.
- Monitor daily consumption rates and estimate days remaining.
- Flag low supplies before they become critical (2-day threshold).
- Suggest resupply opportunities at settlements or natural resources.
Campsite Selection Protocol:
- Evaluate proximity to water (within 100m), natural concealment, and defensibility.
- Consider current weather conditions and terrain protection.
- Identify at least two emergency escape routes from the camp location.
- Balance safety requirements with rest quality and party morale needs.
Signed-off-by: Samantha Coyle <[email protected]>
Signed-off-by: Samantha Coyle <[email protected]>
fix: address conflicts to start
feat: create execution config class
Signed-off-by: Roberto Rodriguez <[email protected]> Signed-off-by: Samantha Coyle <[email protected]>
Signed-off-by: Roberto Rodriguez <[email protected]> Signed-off-by: Samantha Coyle <[email protected]>
Signed-off-by: Roberto Rodriguez <[email protected]> Signed-off-by: Samantha Coyle <[email protected]>
…s abstractions Signed-off-by: Roberto Rodriguez <[email protected]> Signed-off-by: Samantha Coyle <[email protected]>
…tors Signed-off-by: Roberto Rodriguez <[email protected]> Signed-off-by: Samantha Coyle <[email protected]>
…rs to Host Workflow Execution Signed-off-by: Roberto Rodriguez <[email protected]> Signed-off-by: Samantha Coyle <[email protected]>
Signed-off-by: Roberto Rodriguez <[email protected]> Signed-off-by: Samantha Coyle <[email protected]>
… quickstarts to test Agents Signed-off-by: Roberto Rodriguez <[email protected]> Signed-off-by: Samantha Coyle <[email protected]>
Signed-off-by: Roberto Rodriguez <[email protected]> Signed-off-by: Samantha Coyle <[email protected]>
Signed-off-by: Samantha Coyle <[email protected]>
Fix/try rebasing
Signed-off-by: Roberto Rodriguez <[email protected]>
…ypes Signed-off-by: Roberto Rodriguez <[email protected]>
…n API Signed-off-by: Roberto Rodriguez <[email protected]>
…g, AgentExecutionConfig, AgentPubSubConfig) Signed-off-by: Roberto Rodriguez <[email protected]>
…a prompting_helper and execution_config Signed-off-by: Roberto Rodriguez <[email protected]>
…ures for new config API Signed-off-by: Roberto Rodriguez <[email protected]>
Signed-off-by: Roberto Rodriguez <[email protected]>
…ecute_tool_calls, tool_executor Signed-off-by: Roberto Rodriguez <[email protected]>
Signed-off-by: Roberto Rodriguez <[email protected]>
Signed-off-by: Roberto Rodriguez <[email protected]>
…nd use AgentWorkflowEntry Signed-off-by: Roberto Rodriguez <[email protected]>
…pattern Signed-off-by: Roberto Rodriguez <[email protected]>
… construct_messages signatures Signed-off-by: Roberto Rodriguez <[email protected]>
…use AgentWorkflowEntry Signed-off-by: Roberto Rodriguez <[email protected]>
Signed-off-by: Roberto Rodriguez <[email protected]>
Signed-off-by: Roberto Rodriguez <[email protected]>
Signed-off-by: Roberto Rodriguez <[email protected]>
…ning Signed-off-by: Roberto Rodriguez <[email protected]>
…test suite Signed-off-by: Roberto Rodriguez <[email protected]>
…in test_chroma.py Signed-off-by: Roberto Rodriguez <[email protected]>
No description provided.