How nithyasahasra/agentapi works
This is a real-time, multi-agent scam honeypot: an incoming scam message is classified, a persona engages the sender over multiple turns, intelligence is extracted, and results are reported to GUVI. The graph preserves the documented workflow and major capabilities, plus conversation direction, LLM response generation, and session/RL state. Several implementation links are documented only at product level; those edges cite the README. The supplied excerpts do not show endpoint internals, extraction wiring, or GUVI callback invocation.
Main entry points: endpoints.py API endpoints · agent_orchestrator.py Agent orchestrator · base_agent.py Persona agent base · session_manager_enhanced.py Session manager
Components 20
API and sessions
- API endpoints
endpoints.py - API key auth
auth.py - Session manager
session_manager_enhanced.py - Session database
Scam engagement
- Scam classification
scam_classifier_enhanced.py - Agent orchestrator
agent_orchestrator.py - Conversation director
conversation_director_agent.py - Persona agent base
base_agent.py - Five engagement personas
aunty_agent.py - Response generator
response_generator.py - Persona templates
templates.py - LLM client
llm_client.py
Intelligence
- Intelligence extraction
intelligence_extractor.py - Intelligence analyst
intelligence_analyst_agent.py - GUVI callback
guvi_callback.py
Learning and models
- RL agent
rl_agent.py - State encoder
state_encoder.py - Reward calculator
reward_calculator.py
Other components
- Scammer
- LLM providers
Connections 20
- Scammer → API endpoints: sends message
- API endpoints → API key auth: authenticates
- API endpoints → Scam classification: classifies scam
- API endpoints → Session manager: tracks session
- Scam classification → Agent orchestrator: selects engagement
- Agent orchestrator → Conversation director: requests strategy
agent_orchestrator.py - Agent orchestrator → Five engagement personas: creates persona
agent_orchestrator.py - Agent orchestrator → Persona agent base: generates turn
agent_orchestrator.py - Five engagement personas → Persona agent base: extends
- Persona agent base → Response generator: requests response
base_agent.py - Persona agent base → LLM client: invokes fallback
base_agent.py - Response generator → Persona templates: uses persona prompts
- LLM client → LLM providers: calls provider
llm_client.py - API endpoints → Intelligence extraction: extracts intelligence
- Intelligence extraction → Intelligence analyst: analyzes findings
- API endpoints → GUVI callback: reports findings
- Session manager → Session database: persists sessions
session_manager_enhanced.py - Session manager → RL agent: uses RL
session_manager_enhanced.py - RL agent → State encoder: encodes state
- RL agent → Reward calculator: calculates reward