Skip to content

About

Veritas-AI is an intelligent verification system designed to detect misinformation and assess claim credibility using AI-driven analysis, evidence retrieval, and confidence scoring. It helps users evaluate claims with explainable, source-backed results.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

47 Commits

Folders and files

Repository files navigation

title Veritas AI Environment Server
emoji πŸ”
colorFrom blue
colorTo indigo
sdk docker
pinned false
app_port 7860
tags
openenv

Veritas AI β€” Financial Crime Investigation Environment

A real-world OpenEnv environment where an AI agent plays the role of a financial crime analyst β€” querying accounts, tracing money flows, and filing investigation reports.

Built for the Meta PyTorch OpenEnv Hackathon 2026


Why Veritas AI?

Financial crime investigation is one of the highest-value real-world tasks for AI agents. Every major bank and fintech employs human analysts who follow exactly the workflow this environment simulates:

  1. Receive an alert on a suspicious account
  2. Query transaction histories and account profiles
  3. Trace patterns β€” velocity anomalies, structuring, device linkage
  4. File a formal investigation report naming the suspect and scheme

An agent trained in Veritas AI learns investigative reasoning that is directly applicable to real fraud detection pipelines. This is not a toy environment β€” it mirrors production analyst tooling.


Live Demo

Resource URL
HF Space https://huggingface.co/spaces/ratneshhf/veritas-ai
Interactive API docs https://ratneshhf-veritas-ai.hf.space/docs
Health check https://ratneshhf-veritas-ai.hf.space/health
Schema https://ratneshhf-veritas-ai.hf.space/schema

How It Works

Each episode the agent receives an open investigation case with one or more system-generated alerts. It has access to a synthetic financial database and must investigate before the step limit runs out.

reset() β†’ New case opened, initial alerts visible step() β†’ Agent takes one investigative action state() β†’ Episode metadata: steps, score, log

The episode ends when the agent calls submit_report or exhausts its step budget. A deterministic grader scores the report 0.0–1.0 with partial credit at every criterion level.


Action Space

The agent has exactly 4 actions β€” mirroring real analyst tooling:

Action Key fields What it does
query_transactions account_id, optional filters Pull transaction rows for one account
lookup_account account_id Get full profile: device ID, IP, balance, registration
flag_account account_id, reason Formally mark an account as suspicious
submit_report primary_suspect, associates, case_type, evidence_summary File final report β€” triggers grader, ends episode

Example actions:

{"action_type": "lookup_account", "account_id": "ACC-1234"}

{"action_type": "query_transactions", "account_id": "ACC-1234",
 "date_from": "2024-01-01", "date_to": "2024-03-31"}

{"action_type": "flag_account", "account_id": "ACC-1234",
 "reason": "High velocity purchases at suspicious merchants"}

{"action_type": "submit_report",
 "primary_suspect": "ACC-1234",
 "associates": ["ACC-5678"],
 "case_type": "layering_scheme",
 "evidence_summary": "Structured transfers just below reporting threshold, linked device IDs"}

Observation Space

After every reset() and step(), the agent receives:

Field Type Description
case_id string Unique investigation case ID
task_id string Active task identifier
difficulty string easy / medium / hard
task_description string Full task objective
initial_alerts list System alerts that opened the case
accounts_in_scope list Account IDs available to investigate
action_result any Data returned by last action
action_error string Error message if action was invalid
flagged_accounts list Accounts flagged so far this episode
partial_score float Grader score 0.0–1.0, updated on submit
feedback string Human-readable progress hint
reward float Shaped reward for this step
done boolean True when episode ends
steps_taken int Steps used so far
max_steps int Episode step limit

Three Tasks β€” Easy β†’ Medium β†’ Hard

Task 1 β€” Easy β€” Card Scheme

task_id   : task_easy
difficulty: easy
max_steps : 8
case_type : card_scheme

One account is making rapid high-value purchases at unlisted merchants β€” a clear velocity anomaly. The agent must identify the account and submit with case_type = "card_scheme".

Grading: correct suspect (0.50) + correct case type (0.20) + evidence quality (0.15) + no false accusations (0.15)


Task 2 β€” Medium β€” Layering Scheme

difficulty: medium
max_steps : 12
case_type : layering_scheme

Money is moving through a chain of 3–4 accounts in amounts just below the β‚Ή10,000 reporting threshold β€” a classic structuring pattern. The agent must trace the full chain and identify both the origin account (primary suspect) and all intermediaries (associates).

Grading: correct suspect (0.35) + correct associates (0.30) + case type (0.15) + evidence quality (0.15) + no false associates (0.05)


Task 3 β€” Hard β€” Coordinated Ring

task_id   : task_hard
difficulty: hard
max_steps : 18
case_type : coordinated_scheme

A ring of 5–8 accounts controlled by a single operator, linked by shared device fingerprints and IP address subnets. The agent must cross-reference device and IP data to identify the ring operator and all associates β€” a task that requires genuine reasoning beyond pattern matching.

Grading: correct suspect (0.30) + correct associates (0.32) + case type (0.10) + device/IP evidence (0.15) + no false associates (0.08) + partial ring credit (0.05)


Reward Function

Dense, shaped rewards throughout every episode β€” not binary win/lose:

Signal Value When
Step penalty βˆ’0.02 Every step
Query suspicious account +0.05 After query/lookup on scheme account
Query innocent account βˆ’0.02 After query/lookup on innocent
Flag correct suspect +0.10 Immediately on correct flag
Flag correct associate +0.05 Immediately on correct flag
Flag innocent account βˆ’0.10 Immediately on wrong flag
Report β€” correct suspect +0.40 On submit_report
Report β€” correct case type +0.20 On submit_report
Report β€” correct associate +0.10 each On submit_report
Report β€” good evidence +0.15 On submit_report
Report β€” wrong suspect βˆ’0.20 On submit_report
Solve bonus +0.25 First perfect report

Baseline Scores

Our optimized agent utilizes Qwen-2.5-72B-Instruct with custom forensic logic to achieve elite-tier reasoning.

Task Difficulty Baseline Score Status Notes
task_easy Easy 0.85 βœ… Suspect identified and flagged within 3 steps.
task_medium Medium 0.85 βœ… Layering chain successfully traced.
task_hard Hard 0.87 πŸ”₯ High Performance. Identified complex rings using IP/Device metadata.
Average 0.8566 State-of-the-art investigative baseline.

Oracle agent (perfect knowledge) scores: 1.00 / 0.90 / 0.95


Setup & Local Run

# Clone
git clone https://github.com/Rupali2507/Veritas-AI
cd Veritas-AI

# Install
pip install openenv-core fastapi uvicorn pydantic openai

# Run server
python -m uvicorn server.app:app --host 0.0.0.0 --port 7860

# Test
curl http://localhost:7860/health
curl -X POST http://localhost:7860/reset \
  -H "Content-Type: application/json" -d '{}'

# Interactive docs
open http://localhost:7860/docs

Docker

# Build
docker build -t veritas-ai:latest -f server/Dockerfile .

# Run
docker run -p 7860:7860 veritas-ai:latest

# Verify
curl http://localhost:7860/health

Run Baseline Inference

export API_BASE_URL="https://api.groq.com/openai/v1"
export MODEL_NAME="llama-3.1-8b-instant"
export HF_TOKEN="your_groq_api_key"
python inference.py

The inference script uses the OpenAI client pointed at any OpenAI-compatible endpoint. For HuggingFace router:

export API_BASE_URL="https://router.huggingface.co/v1"
export MODEL_NAME="Qwen/Qwen2.5-72B-Instruct"
export HF_TOKEN="hf_your_token"
python inference.py

OpenEnv Validation

# Local spec validation
openenv validate

# Live environment validation
openenv validate --url https://ratnesh18-veritas-ai.hf.space

Result: 6/6 criteria passed βœ…


Project Structure

Veritas-AI/
β”œβ”€β”€ models.py                     # VeritasAction, VeritasObservation, VeritasState
β”œβ”€β”€ inference.py                  # Baseline agent (mandatory, root level)
β”œβ”€β”€ openenv.yaml                  # OpenEnv spec
β”œβ”€β”€ pyproject.toml                # Project metadata
β”œβ”€β”€ uv.lock                       # Locked dependencies
β”œβ”€β”€ client.py                     # Environment client
β”‚
β”œβ”€β”€ veritas_env/
β”‚   β”œβ”€β”€ environment.py            # reset() / step() / state
β”‚   β”œβ”€β”€ tasks.py                  # 3 task definitions + graders
β”‚   β”œβ”€β”€ reward.py                 # Reward constants + calculators
β”‚   β”œβ”€β”€ data_generator.py         # Synthetic scenario generator
β”‚   └── init.py
β”‚
β”œβ”€β”€ server/
β”‚   β”œβ”€β”€ app.py                    # FastAPI server
β”‚   β”œβ”€β”€ Vertias_AI_environment.py # Environment bridge
β”‚   β”œβ”€β”€ Dockerfile                # Container definition
β”‚   └── requirements.txt
β”‚
└── scripts/
└── validate_submission.sh    # Pre-submission checklist

Environment Variables

Set in HF Space settings β†’ Repository secrets:

Variable Description
API_BASE_URL LLM API endpoint (e.g. https://router.huggingface.co/v1)
MODEL_NAME Model identifier (e.g. Qwen/Qwen2.5-72B-Instruct)
HF_TOKEN HuggingFace token or compatible API key

Built With

  • OpenEnv β€” RL environment framework
  • FastAPI β€” HTTP server
  • Pydantic β€” typed models
  • SQLite β€” in-memory synthetic database

Team Alertix

Rupali : Technical Project Lead & Inference Architect (Expertise in Fintech Security & ML).

Ratnesh: Environment Deployment & Infrastructure Lead (HF Spaces & Docker Management).

Meta PyTorch OpenEnv Hackathon 2026 β€” Round 1 Submission

About

Veritas-AI is an intelligent verification system designed to detect misinformation and assess claim credibility using AI-driven analysis, evidence retrieval, and confidence scoring. It helps users evaluate claims with explainable, source-backed results.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages