Add Feedback and Example Learning Components to Flock#243
Merged
Conversation
- Add FeedbackUtilityConfig class with storage, selection, injection, and filtering options - Implement basic FeedbackUtilityComponent class structure with storage backend initialization - Add proper type hints and imports
- Implement feedback retrieval logic with filtering and sorting - Add feedback formatting for injection into agent inputs - Implement on_pre_evaluate lifecycle hook for feedback injection - Add proper error handling and logging
- Add FeedbackUtilityComponent to utility components __init__.py - Update progress tracking for completed phases - Component is now properly discoverable by the registry
- Add feedback support to DefaultAgent with enable_feedback parameter - Update FlockFactory.create_default_agent with comprehensive feedback parameters - Add proper documentation for all new parameters - Component is now fully integrated with the agent creation system
- Create ExampleUtilityComponent with static seed_examples method - Extend SharedLinkStoreInterface to support examples storage - Implement example storage in both SQLite and Azure Table Storage - Add example support to DefaultAgent and FlockFactory - Component enables easy n-shot learning by injecting relevant examples
- Create example demonstrating ExampleUtilityComponent usage - Show how to seed examples and create agents with example learning - Demonstrate how examples are injected into agent inputs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Feedback and Example Learning Components to Flock
Summary
This PR introduces two new utility components to the Flock framework that enable agents to learn from previous interactions:
Both components follow Flock's unified component architecture and integrate seamlessly with the existing agent creation system.
Changes
New Components
FeedbackUtilityComponent (
src/flock/components/utility/feedback_utility_component.py)ExampleUtilityComponent (
src/flock/components/utility/example_utility_component.py)seed_examples()method for easy example populationStorage Extensions
Extended SharedLinkStoreInterface (
src/flock/webapp/app/services/sharing_store.py)save_example()get_example()get_all_examples_for_agent()examplestable in SQLite andflockexamplestable in AzureAgent Integration
Updated DefaultAgent (
src/flock/core/agent/default_agent.py)enable_feedbackandfeedback_configparametersenable_examplesandexample_configparametersUpdated FlockFactory (
src/flock/core/flock_factory.py)Documentation and Examples
Example Implementation (
examples/09-n-shot-learning.py)Usage
Feedback Learning
N-Shot Learning
Testing
The components have been designed with testability in mind:
Breaking Changes
None. All changes are backward compatible:
Benefits
Future Enhancements
Potential areas for future improvement:
Checklist
Review Notes
When reviewing, please pay special attention to:
These components provide a solid foundation for learning systems in Flock and enable agents to improve their performance over time through user feedback and examples.