Module: Legion::Extensions::Agentic::Memory::CommunicationPattern::Runners::CommunicationPattern
- Includes:
- Helpers::Lex
- Included in:
- Client
- Defined in:
- lib/legion/extensions/agentic/memory/communication_pattern/runners/communication_pattern.rb
Instance Method Summary collapse
- #analyze_patterns(agent_id:) ⇒ Object
- #pattern_stats(agent_id:) ⇒ Object
- #update_patterns(agent_id:, traces: []) ⇒ Object
Instance Method Details
#analyze_patterns(agent_id:) ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/legion/extensions/agentic/memory/communication_pattern/runners/communication_pattern.rb', line 25 def analyze_patterns(agent_id:, **) analyzer = analyzer_for(agent_id) { time_of_day_distribution: analyzer.time_of_day_distribution, day_of_week_distribution: analyzer.day_of_week_distribution, channel_preference: analyzer.channel_preference, direct_address_frequency: analyzer.direct_address_frequency, topic_clustering: analyzer.topic_clustering, consistency: analyzer.consistency, trace_count: analyzer.trace_count } end |
#pattern_stats(agent_id:) ⇒ Object
36 37 38 39 40 41 |
# File 'lib/legion/extensions/agentic/memory/communication_pattern/runners/communication_pattern.rb', line 36 def pattern_stats(agent_id:, **) analyzer = analyzer_for(agent_id) { trace_count: analyzer.trace_count, channel_preference: analyzer.channel_preference, consistency: analyzer.consistency } end |
#update_patterns(agent_id:, traces: []) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/legion/extensions/agentic/memory/communication_pattern/runners/communication_pattern.rb', line 13 def update_patterns(agent_id:, traces: [], **) analyzer = analyzer_for(agent_id) analyzer.update_from_traces(traces) { success: true, trace_count: analyzer.trace_count, channel_preference: analyzer.channel_preference, direct_address_frequency: analyzer.direct_address_frequency, consistency: analyzer.consistency } rescue StandardError => e { success: false, error: e. } end |