UDARA, Nsk,ai. Build Crew: Team‑Africod: *Project: AfriTrade Agent – Voice‑first assistant for informal cross‑border traders in Africa
# 🌍 AfriTrade Agent — ECOWAS Trade Intelligence Platform
AfriTrade Agent is a production-grade, multi-step agentic system designed to answer complex cross-border trade, tariff, and routing questions across UEMOA and ECOWAS West Africa. By combining vector similarity search over regional common external tariffs, graph database pathfinding across commercial transit corridors, and a real-time voice interface, AfriTrade AI equips customs brokers, traders, and logistics managers with instant, compliant trade intelligence.
---
## ⚙️ Core Capabilities
- **🎙️ Voice-First Interface** — Speech-to-text (STT) query ingestion powered by Groq Whisper (`whisper-large-v3`) with automated voice response generation using Google Text-to-Speech (gTTS).
- **🧠 Multi-Hop RAG with Relevance Grading** — Two-stage adaptive tariff retrieval. It searches tariff databases via Qdrant, grades retrieval chunks using LLM scoring (0-10), filters low-relevance documents, and dynamically reformulates queries for a second retrieval hop if information density is low.
- **🛣️ Hybrid Graph Routing** — Pathfinding across 9 key West African transport hubs and corridors (Lagos, Abidjan, Bamako, Dakar, etc.) utilizing a primary Neo4j graph database with an offline-ready NetworkX local graph fallback.
- **📊 Production Observability** — Structured JSON logging to rotating file handlers (`logs/agent.log`), per-node latency telemetry, and SQLite-backed persistent error tracking visualized in a dedicated Admin Dashboard.
---
## 🧠 System Architecture & Data Flow
```mermaid
flowchart TD
%% Input Section
User([🧑 User Interaction])
Voice[🎙️ Voice Record\nStreamlit Input]
STT[🗣️ Groq Whisper STT\nwhisper-large-v3]
Text[📝 Query Text]
User -->|Voice| Voice
User -->|Text| Text
Voice --> STT
STT --> Text
%% Agentic Orchestration Layer
subgraph Agentic Pipeline [LangGraph State Machine Orchestrator]
Router[🧭 Router Node\nGemini 2.5 Flash / Regex]
%% RAG Subsystem
subgraph Multi-Hop RAG [Multi-Hop RAG with Grading] …