Open
Conversation
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.
PR Review: Agent Module & Monitor Agent
Context & Motivation
This PR introduces a new Agent Module for Mindtrace addressing following (A sub sub issue under Github Issue #310):
This PR solves these issues by introducing:
AgentRegistry)BaseAgentWorkflowConfig) that supports multiple LLM providers and agent modelsKey Features
1. Discoverability & Registry System
The
AgentRegistryprovides a centralized way to discover and register agents:2. Configurability & BaseAgentWorkflowConfig
The
BaseAgentWorkflowConfigextendsCoreConfigto provide a unified configuration system:Key Components:
__delimiter3. Monitor Agent Use Case
The Monitor Agent demonstrates the framework's capabilities with a real-world use case:
Natural Language → LogQL Query Generation
The monitor agent converts natural language queries into LogQL queries for Loki:
How It Works:
Query Generator Agent: Takes natural language input and generates LogQL queries
extract_logstool to sample logs if neededLog Analyzer Agent: Analyzes extracted logs and provides insights
Loki Integration: Direct integration with Loki API
Example Flow:
Commands
Agent Discovery
Monitor Agent Commands
Architecture: Agent & Workflow Pattern
Core Concept
Agent = Class, Methods = Workflows
An agent is a class that inherits from
BaseAgent. Each method in the agent class represents a workflow - a specific command or feature the agent provides. ABaseAgentacts as the boundary for an agent domain. It can orchestrate multiple models and providers, with domain-specific agent commands exposed as methods on the class.Example:
Multiple Commands per Agent
Agents can support multiple workflows, each serving a different purpose. For instance a Monitoring Agent can have following features:
Each workflow is a method that can be:
Chat Interface & Service Integration
Current State:
query,configure)Future Vision:
Generic Chat Interface: A unified chat CLI that works with any agent
mindtrace agents chat monitor # Interactive chat session with monitor agentService Integration: Agents can be served as FastAPI services
Workflow Hooks: Workflows can be triggered by:
Testing & Examples
See
samples/agents/monitor_setup/plc_service/for: