IPTU Agent is an AI-powered assistant for Brazilian real estate data (IPTU - Property Tax), built on Google's ADK-Go framework. It demonstrates production-ready AI agent development with hexagonal architecture.
Pattern: Hexagonal Architecture (Ports & Adapters)
cmd/agent/ → Application entry point, DI wiring
internal/
config/ → Centralized configuration (env vars)
domain/
entity/ → Domain entities (Property, MarketAnalysis)
port/ → Interfaces (PropertyRepository)
service/ → Business logic (PropertyService)
infrastructure/
api/ → HTTP client implementation (adapter)
interfaces/
tool/ → ADK tool implementations (adapter)
pkg/errors/ → Typed errors with codes
- Hexagonal Architecture: Domain logic isolated from infrastructure
- Interface-based DI: Easy testing with mock implementations
- Centralized Config: Single source of truth, fail-fast validation
- Typed Errors: Error codes for proper handling and API responses
- Value Objects: Money, Area, Address as value objects
# Run with mock data
GOOGLE_API_KEY=xxx IPTU_USE_MOCK=true go run ./cmd/agent --console
# Run tests
go test ./... -v -cover
# Build
go build -o iptu-agent ./cmd/agentAll config via environment variables. Required: GOOGLE_API_KEY.
See .env.example for full list.
- Uses
llmagent.New()for LLM-powered agent - Custom tools via
functiontool.New() - Launcher for CLI/Web/API modes
- Property: Main entity with Address, Area, Valuation, Classification
- MarketAnalysis: Neighborhood statistics
- Money: Value object for currency formatting
- Unit tests colocated with packages
- Mock repository for service tests
- Table-driven tests
- Coverage target: 80%+