Skip to content

Repository files navigation

Vartovii Trust Intelligence Agent

Evidence-backed multi-agent trust investigation system for companies, crypto projects, and wallets - powered by Vertex AI Gemini, Google ADK, MongoDB Atlas, and MongoDB MCP.

Google ADK Vertex AI Gemini MongoDB Atlas MCP License: MIT Tests


Judge-Ready Links

Surface Link What judges can verify
Hosted product https://vartovii-trust-agent-n7kszqvpoq-ew.a.run.app Live Cloud Run product UI
Readiness proof https://vartovii-trust-agent-n7kszqvpoq-ew.a.run.app/api/readiness Gemini model, MongoDB status, Agent Engine path, MCP setup, test count
Judge trace https://vartovii-trust-agent-n7kszqvpoq-ew.a.run.app/api/judge-trace Agent route, evidence, decision path, audit events, MongoDB proof
Live CoinGecko proof https://vartovii-trust-agent-n7kszqvpoq-ew.a.run.app/api/live-proof?slug=ethereum Live market evidence plus MongoDB Atlas cache persistence
Live Etherscan proof https://vartovii-trust-agent-n7kszqvpoq-ew.a.run.app/api/wallet-live-proof Live ETH wallet balance proof plus MongoDB Atlas cache persistence
Open-source repo https://github.com/Vetassikc/vartovii-trust-agent MIT license, source code, docs, tests, deploy scripts

Why Vartovii?

Trust work usually fails in two ways: data is scattered, and AI answers are hard to verify. A user may need to check market APIs, blockchain explorers, company records, search results, and internal notes before making one trust decision.

Vartovii is built around visible investigation, not a black-box answer. A judge can verify that the system:

  • routes work through specialist Google ADK agents;
  • uses Gemini 3.5 Flash as the active production model;
  • pulls live CoinGecko and Etherscan evidence;
  • stores investigations, audit events, and live proof in MongoDB Atlas;
  • exposes proof through readiness, judge trace, live evidence, and wallet proof endpoints;
  • uses MongoDB MCP as a flexible database inspection path beyond fixed tools.

The result is an evidence-first trust console: route, score, sources, persistence, and decision in one inspectable workflow.

Standalone Hackathon Context

This repository is packaged as a standalone contest build created for the Google Cloud Rapid Agent Hackathon. The domain comes from trust intelligence research patterns, while the submitted agent graph, proof endpoints, UI, tests, deployment scripts, MongoDB Atlas integration, and MongoDB MCP path are focused on this judge-verifiable hackathon implementation.


πŸ—οΈ Architecture

graph TB
    User([πŸ§‘ User Query]) --> Orchestrator

    subgraph "Vartovii ADK Multi-Agent System"
        Orchestrator["🎯 Orchestrator Agent<br/>Gemini 3.5 Flash<br/><i>Pure delegation β€” never answers directly</i>"]

        Orchestrator -->|"Company questions"| Corporate["🏒 Corporate Agent<br/>6 FunctionTools"]
        Orchestrator -->|"Crypto questions"| Crypto["πŸͺ™ Crypto Agent<br/>6 FunctionTools"]
        Orchestrator -->|"Web research"| OSINT["πŸ” OSINT Agent<br/>GoogleSearchTool"]
        Orchestrator -->|"Save & recall"| Memory["🧠 Memory Agent<br/>4 FunctionTools"]
        Orchestrator -->|"Ad-hoc DB questions"| MCPAgent["πŸƒ MongoDB MCP Agent<br/>(optional)"]
        MCPAgent --> MCP["πŸ”Œ MongoDB MCP Server"]
    end

    Corporate --> DB[(MongoDB Atlas)]
    Crypto --> DB
    Memory --> DB
    MCP --> DB

    Corporate --> CT1[search_company]
    Corporate --> CT2[get_trust_score]
    Corporate --> CT3[compare_companies]
    Corporate --> CT4[list_companies]
    Corporate --> CT5[get_company_reviews]
    Corporate --> CT6[get_vacancy_intelligence]

    Crypto --> CRT1[search_crypto_projects]
    Crypto --> CRT2[get_crypto_trust_score]
    Crypto --> CRT3[check_wallet]
    Crypto --> CRT4[get_transaction_history]
    Crypto --> CRT5[get_token_holders]
    Crypto --> CRT6[get_contract_info]

    Memory --> M1[save_investigation]
    Memory --> M2[get_investigation_history]
    Memory --> M3[log_audit_event]
    Memory --> M4[get_audit_trail]

    OSINT --> GS[Google Search Grounding]

    style Orchestrator fill:#1a73e8,stroke:#1557b0,color:#fff
    style Corporate fill:#34a853,stroke:#2d8e47,color:#fff
    style Crypto fill:#ea8600,stroke:#c77200,color:#fff
    style OSINT fill:#9334e6,stroke:#7b2bc1,color:#fff
    style Memory fill:#e8453c,stroke:#c23a32,color:#fff
    style MCP fill:#47A248,stroke:#3d8b3d,color:#fff
    style DB fill:#47A248,stroke:#3d8b3d,color:#fff
Loading

5 core agents, 28 custom tools, and an optional MongoDB MCP specialist β€” orchestrated by Google ADK for autonomous trust intelligence.


✨ Key Features

Feature Description
πŸ€– Multi-Agent Orchestration 5 specialized LlmAgents coordinated via Google ADK β€” each with its own tools, context, and domain expertise
πŸƒ MongoDB Atlas + MCP Structured PyMongo tools handle production workflows; the optional mongodb-mcp-server specialist handles ad-hoc collection inspection, aggregation, and explain-plan work
πŸ“‘ Live Evidence Proof /api/live-proof fetches CoinGecko market evidence, while /api/wallet-live-proof fetches Etherscan ETH balance evidence and persists both proof paths in MongoDB Atlas cache
πŸ”„ Model Fallback Production uses Vertex AI Gemini 3.5 Flash with a 3.1 Flash-Lite cost profile and explicit 3.1 Pro preview opt-in
🧠 Investigation Memory Cross-session persistence: agents save & recall past investigations via MongoDB
πŸ“‹ Audit Events Investigation and proof actions are recorded with agent, action, model, latency, and timestamp metadata
πŸ” OSINT Grounding Real-time web research via Google Search Grounding for entities not in database
πŸ“Š 28 Specialized Tools Corporate analytics, crypto forensics, wallet checks, on-chain analysis, similarity search, network risk, investigation management
πŸ§ͺ 63 Automated Tests Architecture validation, MCP construction, live proof contracts, dashboard fallback/readiness behavior, model routing, service layer coverage

πŸš€ Quick Start

Prerequisites

Setup

# Clone the repository
git clone https://github.com/Vetassikc/vartovii-trust-agent.git
cd vartovii-trust-agent

# Create virtual environment
python -m venv .venv && source .venv/bin/activate

# Install dependencies
pip install -e '.[dev]'

# Configure environment
cp .env.example .env
# Fill in GOOGLE_API_KEY, MONGODB_CONNECTION_STRING, and optional ETHERSCAN_API_KEY

Seed MongoDB with Demo Data

python scripts/seed_mongodb.py

This populates your MongoDB Atlas cluster with:

  • 🏒 Corporate entities with trust scores, reviews, vacancy data
  • πŸͺ™ Crypto projects with tokenomics, on-chain metrics, holder distributions
  • πŸ”— Wallet records and transaction histories

To restore the non-destructive judge proof path without dropping core collections, run:

python scripts/seed_judge_evidence.py

This upserts the Wirecard judge investigation, replayable audit events, and normalizes legacy audit model labels to the active Gemini policy.

Run the Agent

# ADK Web Interface (recommended for demo)
adk web agent/

# Or run interactive demo scenarios
python -m demo.run_demo

Deploy

# Web console + FastAPI + MongoDB MCP child process
./scripts/deploy.sh

# ADK agent graph on Google Cloud Agent Engine
GOOGLE_CLOUD_PROJECT=your-project ./scripts/deploy_agent_engine.sh

Cloud Run is the primary hosted product demo because the container includes the dashboard API, static web console, and Node.js runtime for mongodb-mcp-server. Agent Engine deployment proves the ADK agent graph is ready for Google Cloud's hosted agent runtime; set MONGODB_MCP_ENABLED=true only in runtimes where the MongoDB MCP child process is available.

The Agent Engine deploy helper uses a temporary sanitized env file by default: it keeps MCP disabled and uses mock data fallback so the hosted graph can be deployed without copying local secrets. The Cloud Run deployment remains the live MongoDB + MCP product surface.


πŸƒ MongoDB MCP Integration

Vartovii connects to MongoDB Atlas through two complementary pathways:

1. Custom PyMongo Tools (Structured Access)

Each agent uses purpose-built FunctionTools that query MongoDB collections through a singleton connection manager (agent/tools/db.py):

# Example: Corporate Agent's search_company tool
from agent.tools.db import get_collection

collection = get_collection("companies")
result = collection.find({"name": {"$regex": query, "$options": "i"}})

2. MongoDB MCP Server (Dynamic Access)

The official mongodb-mcp-server runs as a subprocess, exposing MongoDB operations via the Model Context Protocol:

# Initialized in agent/adk_agent.py as an optional MongoDB MCP specialist
toolset = McpToolset(
    connection_params=StdioConnectionParams(
        server_params=StdioServerParameters(
            command="npx",
            args=["-y", "mongodb-mcp-server"],
            env={"MONGODB_CONNECTION_STRING": conn_string},
        ),
        timeout=10.0,
    ),
)

This gives the ADK graph direct, flexible database access through a dedicated MCP specialist β€” it can run ad-hoc finds, aggregations, and explain plans without needing a pre-built tool for every query pattern.

MongoDB Collections

Collection Purpose Key Fields
companies Corporate entity data name, trust_score, country, industry, reviews
crypto_projects Crypto project profiles name, symbol, trust_score, tvl, security_score
wallets Blockchain wallet records address, chain, balance, transactions
investigations Saved investigation results entity_name, entity_type, trust_score, risk_level, timestamp
audit_log Agent action audit trail agent, action, model_used, latency_ms, timestamp

πŸ› οΈ Tech Stack

Layer Technology
AI Framework Google Agent Development Kit (ADK) 2.0.0
Models Vertex AI Gemini 3.5 Flash GA; Gemini 3.1 Flash-Lite cost profile; Gemini 3.1 Pro preview opt-in
Database MongoDB Atlas β€” cloud-hosted document database
MCP Server mongodb-mcp-server β€” official MongoDB MCP integration
Driver PyMongo 4.7+ with connection pooling & retry
Language Python 3.11+
Search Google Search Grounding (OSINT agent)
Testing pytest 8.0+, pytest-asyncio
Deployment Google Cloud Run web demo + ADK Agent Engine deployment path + MongoDB Atlas

πŸ“ Project Structure

vartovii-trust-agent/
β”œβ”€β”€ agent/                          # Core ADK agent definitions
β”‚   β”œβ”€β”€ __init__.py                 # Package init (exports root_agent)
β”‚   β”œβ”€β”€ agent.py                    # ADK entry point (symlink to adk_agent.py)
β”‚   β”œβ”€β”€ adk_agent.py                # Root orchestrator + 4 sub-agents + MCP
β”‚   β”œβ”€β”€ requirements.txt            # Agent Engine packaging dependencies
β”‚   β”œβ”€β”€ config.py                   # Model routing, fallback chains, MongoDB config
β”‚   β”œβ”€β”€ prompts/
β”‚   β”‚   └── adk.py                  # Agent instruction prompts
β”‚   └── tools/
β”‚       β”œβ”€β”€ corporate_tools.py      # 6 corporate intelligence tools
β”‚       β”œβ”€β”€ crypto_tools.py         # 6 crypto forensics tools
β”‚       β”œβ”€β”€ investigation_tools.py  # 4 investigation & audit tools
β”‚       β”œβ”€β”€ db.py                   # MongoDB connection manager (singleton)
β”‚       β”œβ”€β”€ live_data.py            # CoinGecko and Etherscan live evidence helpers
β”‚       └── mock_data.py            # Fallback demo data providers
β”œβ”€β”€ services/                       # Service layer
β”‚   β”œβ”€β”€ model_runtime.py            # Model execution with fallback chain
β”‚   β”œβ”€β”€ routing_adapter.py          # Chat routing adapter
β”‚   └── telemetry.py                # Metrics and monitoring
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ deploy.sh                   # Cloud Run web demo deploy
β”‚   β”œβ”€β”€ deploy_agent_engine.sh      # ADK Agent Engine deploy
β”‚   └── seed_mongodb.py             # Seed MongoDB Atlas with demo data
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ test_agent.py               # 38 agent architecture & tool tests
β”‚   β”œβ”€β”€ test_dashboard_api.py       # 12 dashboard fallback/readiness/live-proof contract tests
β”‚   └── test_services.py            # 13 service layer tests
β”œβ”€β”€ demo/
β”‚   └── run_demo.py                 # Interactive demo runner (5 scenarios)
β”œβ”€β”€ web/                            # Dashboard frontend
β”‚   β”œβ”€β”€ index.html                  # Main UI
β”‚   β”œβ”€β”€ style.css                   # Styles
β”‚   └── app.js                      # Frontend logic
β”œβ”€β”€ evidence/                       # Hackathon submission evidence
β”‚   β”œβ”€β”€ optimization_metrics.md     # Before/after metrics
β”‚   β”œβ”€β”€ production_rollout_report.md
β”‚   └── screenshots/
β”œβ”€β”€ AGENTS.md                       # Repository rules for coding agents
β”œβ”€β”€ AGENT_ROLE_MAPPING.md           # Agent ownership, tools, and handoff rules
β”œβ”€β”€ MODEL_POLICY.md                  # Model routing, fallback, and preview policy
β”œβ”€β”€ PROJECT_CONTEXT.md              # Product context and judging narrative
β”œβ”€β”€ SOURCE_UPDATE_POLICY.md         # Evidence freshness and source governance
β”œβ”€β”€ pyproject.toml                  # Project config & dependencies
β”œβ”€β”€ .env.example                    # Environment variable template
β”œβ”€β”€ ARCHITECTURE.md                 # Detailed technical architecture
β”œβ”€β”€ LICENSE                         # MIT License
└── README.md                       # ← You are here

πŸ§ͺ Testing

# Run all tests
pytest tests/ -v

# Run with coverage
pytest tests/ -v --tb=short

Test Coverage

Test Suite Tests Coverage
test_agent.py 38 Agent topology, tool registration, MCP integration, fallback chains, audit model policy
test_dashboard_api.py 12 Dashboard mock fallback, readiness endpoint, CoinGecko and Etherscan live proof contracts, judge trace, health model metadata, leaderboard and entity detail contracts
test_services.py 13 Model runtime, routing adapter, telemetry, config validation
Total 63 Architecture, tools, dashboard API, MongoDB fallback/readiness/live proof, services

Key test categories:

  • βœ… Agent architecture β€” verifies 5-agent topology, correct tool assignment
  • βœ… Tool contracts β€” validates custom tools and dashboard API contracts return expected schemas
  • βœ… MongoDB integration β€” connection manager, collection access, graceful fallback
  • βœ… Model routing β€” profile switching and resilient fallback chains
  • βœ… MCP toolset β€” initialization, error handling, connection params

πŸ“„ Demo Scenarios

🏒 Corporate Trust Assessment

> "Analyze SAP as an employer"
β†’ Orchestrator β†’ Corporate Agent
β†’ search_company("SAP") β†’ get_trust_score("SAP")
β†’ Trust Score: 74/100 | Risk: MEDIUM | 6-pillar breakdown
β†’ Memory Agent saves investigation to MongoDB

πŸͺ™ Crypto Project Analysis

> "Give me the full trust assessment for Uniswap"
β†’ Orchestrator β†’ Crypto Agent
β†’ search_crypto_projects("Uniswap") β†’ get_crypto_trust_score("uniswap")
β†’ Trust Score: 78/100 | Security: HIGH | TVL, dev activity, audit status
β†’ Memory Agent saves investigation to MongoDB

πŸ“‘ Live Evidence Proof

GET /api/live-proof?slug=ethereum
β†’ Crypto proof path fetches CoinGecko market evidence
β†’ Trust delta is computed from 24h movement
β†’ MongoDB Atlas caches the live evidence for audit and MCP inspection
β†’ Response exposes source URL, freshness, persistence status, and agent trace

GET /api/wallet-live-proof
β†’ Wallet proof path fetches native ETH balance from Etherscan API V2
β†’ Balance evidence is normalized for judge-readable proof cards
β†’ MongoDB Atlas caches the wallet evidence for audit and MCP inspection
β†’ Response exposes source URL without apikey, freshness, persistence status, and agent trace

πŸ”— Blockchain Forensics

> "Check wallet 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
β†’ Orchestrator β†’ Crypto Agent
β†’ check_wallet("0xd8dA...") β†’ get_transaction_history("0xd8dA...")
β†’ Live balance from Etherscan when configured | Recent transactions | Risk flags

πŸ“‹ Investigation History

> "Show me all past crypto investigations"
β†’ Orchestrator β†’ Memory Agent
β†’ get_investigation_history(entity_type="crypto")
β†’ List of past investigations with scores and timestamps

πŸ“ Model Configuration

Runtime Fallback Chain

Primary task model  ──on error──▢  Task fallback when different  ──on error──▢  Ultimate fallback
Profile Agent Model Chat Model Report Model
stable gemini-3.5-flash gemini-3.5-flash gemini-3.5-flash
cost gemini-3.1-flash-lite gemini-3.1-flash-lite gemini-3.1-flash-lite
preview gemini-3.5-flash gemini-3.5-flash gemini-3.1-pro-preview

All models are environment-overridable. The resolved chain deduplicates repeated model names, so stable chat and agent paths currently resolve to gemini-3.5-flash -> gemini-2.0-flash. The fallback policy reduces user-visible model failures without hiding routing metadata.


πŸ“œ License

MIT β€” Vitalii Radionov, 2026


πŸ† Built for Google Cloud Rapid Agent Hackathon β€” MongoDB Track
Autonomous multi-agent trust intelligence powered by Vertex AI Gemini, Google ADK, and MongoDB Atlas via MCP

About

Standalone Vartovii Google Cloud hackathon build for evidence-backed multi-agent trust investigations; not the core product repository.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages