Detective Aigency
This example demonstrates a multi-agent system for a detective agency built with the Aigency framework. The system is composed of three specialized agents that work in coordination to solve complex cases.
Use Cases
This system supports everything from simple inquiries to fully coordinated investigations.
Direct Interaction with Agents
You can interact directly with specialized agents for specific tasks. With the Case Agent:
"Analyze the robbery case at 'The Diamond' jewelry store - evidence includes: fingerprints, security footage, and an eyewitness."
With the Informant Agent:
"Find informants specializing in jewelry heists in the downtown area."
Using the Detective Manager
For complex cases, the Detective Manager orchestrates the entire investigation. Example Prompt:
"Investigate the corporate fraud case at TechCorp - I need an analysis of financial evidence and contact with informants in the tech sector."
The Detective Manager will automatically:
- Delegate the evidence analysis to the
Case Agent
. - Coordinate with the
Informant Agent
to gather additional intel. - Integrate the results to provide a comprehensive investigation report.
Common Scenarios
Robbery Case:
Case Agent
analyzes physical and digital evidence.Informant Agent
contacts informants in the area.Detective Manager
coordinates the information to identify suspects. Fraud Case:Case Agent
examines financial documents and transaction patterns.Informant Agent
seeks contacts within the financial sector.Detective Manager
develops a comprehensive investigation strategy.
System Architecture
The agency operates with three core agents, each with a distinct role, and two supporting MCP (Model Context Protocol) services.
Specialized Agents
Lead Detective Orchestrator
This agent is the brain of the operation. It doesn’t investigate directly but coordinates the other agents to ensure the investigation proceeds efficiently.
Key Responsibilities:
- Coordinates complex, multi-faceted investigations.
- Delegates specific tasks to specialized agents.
- Integrates information from all sources into a unified view.
- Manages the overall investigation workflow.
Case Specialist Detective
This agent is responsible for analyzing all tangible information in the case to build a solid foundation for the investigation.
Key Responsibilities:
- Analyzes evidence and develops case theories.
- Creates detailed profiles of suspects.
- Generates investigation reports for the team.
- Manages and updates the status of cases.
MCP (Model Context Protocol) Services
- Case Management MCP: Handles cases, evidence, and reports.
Informant Network Specialist
Acts as the link to the outside world, managing a network of contacts to obtain information not found in official reports.
Key Responsibilities:
- Manages the agency’s network of informants.
- Schedules secure and discreet meetings.
- Evaluates the credibility of received information.
- Maintains a reliability record for informants.
MCP (Model Context Protocol) Services
- Informant Management MCP: Manages informants and their meetings.
Diagram of the System
How to Run
Prerequisites
Install Docker and Docker Compose
Follow the instructions for your operating system to install Docker and Docker Compose.
Download the Repository
git clone https://github.com/aigency-project/demo-detective-aigency
Configure your environment variables in a .env
file in the project root
Visit Google AI Studio to generate your Gemini API key, since this agent uses the gemini-2.0-flash model.
GEMINI_API_KEY=your_gemini_api_key
GOOGLE_GENAI_USE_VERTEXAI=FALSE
Execution
Run the following command from the detective_agency
directory:
docker-compose up --build
Access Ports
Once running, the services are available at these ports:
Detective Manager Agent
: http://localhost:8080 (Main entry point)Case Agent
: http://localhost:8082Informant Agent
: http://localhost:8084Phoenix Observability
: http://localhost:6006A2A Inspector
: http://localhost:6007
Monitoring and Observability
- Phoenix: An observability dashboard is available at http://localhost:6006.
- A2A Inspector: Agent inspection tools can be found at http://localhost:6007.
- Logs: Each agent generates detailed logs for tracking and debugging.
Extensibility
The system is designed to be easily expanded:
- New Agents: Add a Forensics Agent, Cybersecurity Agent, or Legal Agent.
- New MCPs: Integrate a criminal database, surveillance system, or communications analysis service.
- New Skills: Implement DNA analysis, digital investigation, or social media analysis.