Part II: Agent Intelligence
Where specialized agents come alive: Security, Energy, and the testing infrastructure that proves they work.
The Agents Awaken
With the foundation in place, it was time to build intelligent agents - specialized AI systems that could perceive, reason, and act within the building environment.
This is the story of:
- Security Agent: Threat detection and coordinated response
- Testing Infrastructure: Professional-grade validation
- MCP & OPA Integration: Real tool execution and policy enforcement
- Energy Agent: Mathematical optimization for efficiency
What You'll Learn
Chapter 7: Security Agent
LangGraph state machine for autonomous security responses.
Chapter 7.5: Testing Infrastructure
2,300+ lines of tests, fixtures, mocks, and documentation.
Chapter 7.6: MCP & OPA Awakening
Real MCP tool invocation and OPA policy evaluation (not mocks!).
Chapter 8: Energy Agent
Scipy-based optimization for HVAC and demand response.
Agent Intelligence Complete ✅
By the end of Part II, we had:
- ✅ Security Agent with 5-state machine (MONITOR → ANALYZE → DECIDE → ACT → MONITOR)
- ✅ 65+ comprehensive tests (unit, integration, E2E)
- ✅ Real MCP tool execution (door locks, cameras, alerts)
- ✅ Real OPA policy enforcement (production-ready)
- ✅ Energy Agent with scipy optimization
- ✅ Professional testing infrastructure
Continue the journey → Chapter 7: Security Agent