How jrgkog/foai-project-multiagent works
This is a CLI container-resource advisor demo. A user selects normal, CPU-stress, or memory-stress scenarios; the CLI starts workload processes, samples their metrics, runs each service through a four-agent LangGraph analysis, and displays scaling advice. The agents share validated state and use Gemini with deterministic fallbacks. The README is empty; the workflow and links below are grounded in the shown excerpts and SOURCE INDEX. Some CLI collection and shutdown details are omitted from the excerpt, so their internal sequence is not expanded.
Main entry points: main.py Scenario runner · llm_factory.py LLM factory · state.py Typed agent state · monitoring_agent.py Monitoring agent
Components 13
CLI workflow
- Scenario runner
main.py - Agent pipeline
pipeline.py
Workload and metrics
- Load processes
services.py - Process metrics
tools/process_metrics.py
Advisor agents
- Monitoring agent
agents/monitoring_agent.py - Bottleneck analysis
agents/bottleneck_agent.py - Scaling decision
agents/scaling_agent.py - Recommendation
agents/recommendation_agent.py
Shared intelligence
- Typed agent state
agents/state.py - LLM factory
agents/llm_factory.py
Other components
- CLI user
- Gemini API
- psutil process API
Connections 20
- CLI user → Scenario runner: selects scenario
main.py - Scenario runner → Load processes: spawns workloads
main.py - Scenario runner → Process metrics: collects metrics
main.py - Process metrics → psutil process API: samples process
tools/process_metrics.py - Scenario runner → Agent pipeline: runs analysis
main.py - Agent pipeline → Monitoring agent: dispatches first
pipeline.py - Monitoring agent → Bottleneck analysis: passes state
pipeline.py - Bottleneck analysis → Scaling decision: passes state
pipeline.py - Scaling decision → Recommendation: passes state
pipeline.py - Monitoring agent → Typed agent state: validates metrics
agents/monitoring_agent.py - Bottleneck analysis → Typed agent state: models results
agents/bottleneck_agent.py - Scaling decision → Typed agent state: models decision
agents/scaling_agent.py - Recommendation → Typed agent state: models result
agents/recommendation_agent.py - Agent pipeline → Typed agent state: types graph state
pipeline.py - Monitoring agent → LLM factory: requests summary
agents/monitoring_agent.py - Bottleneck analysis → LLM factory: requests diagnosis
agents/bottleneck_agent.py - Scaling decision → LLM factory: requests decision
agents/scaling_agent.py - Recommendation → LLM factory: requests narrative
agents/recommendation_agent.py - LLM factory → Gemini API: generates content
agents/llm_factory.py - Scenario runner → CLI user: displays report
main.py