Skip to content

20Aarya05/three-point-zero-trustweave

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌟 TrustWeave - AI-Powered Financial Trust Assessment System

Team Name: Three Point Zero

Revolutionizing financial inclusion through behavioral trust analysis and AI-driven credit assessment

AI Powered Gemini Integration TypeScript React Node.js

πŸš€ What is TrustWeave?

TrustWeave is a cutting-edge AI-powered financial trust assessment platform that evaluates creditworthiness through behavioral patterns rather than traditional credit scores. Perfect for underbanked populations and emerging markets, it uses Google Gemini AI to analyze:

  • πŸ“± Mobile Usage Patterns - SIM duration, recharge regularity, usage consistency
  • ⚑ Utility Payment Behavior - On-time payments, delay patterns, bill predictability
  • 🀝 Community Engagement - Group participation, shared responsibility, dispute history
  • πŸ“„ Evidence Documentation - Bills, receipts, payment proofs with AI analysis
  • πŸ’Ό Financial Capacity - Employment, income stability, asset information

✨ Key Features

🧠 AI-Powered Analysis

  • 5 Specialized AI Agents working in harmony
  • Google Gemini Integration for intelligent reasoning
  • Behavioral Pattern Recognition across multiple domains
  • Bias Detection & Fairness built-in protection

🎯 Trust Band System

  • T5 - Exceptional Trust (750-850 equivalent)
  • T4 - Strong Trust (700-749 equivalent)
  • T3 - Developing Trust (650-699 equivalent)
  • T2 - Emerging Trust (600-649 equivalent)
  • T1 - Limited Trust (550-599 equivalent)

πŸ’‘ Personalized Recommendations

  • Specific improvement actions with timelines
  • Next-level roadmap for trust band advancement
  • Encouraging guidance and progress tracking
  • Cultural context awareness for fair assessment

πŸ›‘οΈ Enterprise-Grade Security

  • No database dependencies - runs standalone
  • Environment variable protection
  • Rate limiting and security headers
  • Graceful error handling with fallbacks

πŸ—οΈ Architecture Overview

graph TD
    A[User Input] --> B[Purpose & Routing Agent]
    B --> C[Data Interpretation Agent]
    C --> D[Trust Reasoning Agent]
    D --> E[Bias & Fairness Agent]
    E --> F[Improvement & Guidance Agent]
    F --> G[Personalized Results]
    
    H[Gemini AI] --> C
    H --> D
    H --> E
    H --> F
Loading

πŸ€– 5 AI Agents System

  1. Purpose & Routing Agent - Determines assessment strategy based on loan purpose
  2. Data Interpretation Agent - AI-powered behavioral pattern analysis
  3. Trust Reasoning Agent - Intelligent trust band assignment with context
  4. Bias & Fairness Agent - Ensures fair treatment and bias correction
  5. Improvement & Guidance Agent - Generates personalized recommendations

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • npm or yarn
  • Google Gemini API Key (Get it here)

1. Clone & Install

git clone https://github.com/20Aarya05/three-point-zero-trustweave.git
cd three-point-zero-trustweave
npm install

2. Environment Setup

# Copy environment template
cp .env.example .env

# Add your Gemini API key
echo "GEMINI_API_KEY=your_actual_gemini_api_key_here" >> .env

3. Start Backend

npm run dev

βœ… Server runs on http://localhost:3001

4. Start Frontend

cd frontend
npm install
npm run dev

βœ… Frontend runs on http://localhost:5173

πŸ“– API Documentation

🎯 Trust Assessment Endpoint

POST /api/trust/assess
Content-Type: application/json

Request Body:

{
  "purpose": "medium",
  "mobile": {
    "simDuration": "more_than_2_years",
    "rechargeRegularity": "very_regular",
    "usageConsistency": "very_stable"
  },
  "utility": {
    "onTimePayment": "always",
    "delayFrequency": "never",
    "billPredictability": "very_consistent"
  },
  "community": {
    "groupParticipation": "very_active",
    "sharedResponsibility": "high",
    "disputeHistory": "clear"
  },
  "evidence": [],
  "loanExperience": "never",
  "financial": {
    "employmentType": "government",
    "incomeRange": "30k-50k",
    "incomeStability": "very_stable"
  },
  "assets": {
    "property": false,
    "fixedDeposits": true,
    "collateralWillingness": true
  }
}

Response:

{
  "trustBand": "T4 - Strong Trust",
  "interpretation": "Outstanding financial reliability! You demonstrate exceptional consistency across all behavioral areas.",
  "traditionalAlignment": "700-749",
  "reasoning": [
    "Outstanding 2+ year mobile relationship with very regular recharge patterns",
    "Perfect utility payment record with no delays demonstrates financial discipline",
    "Very active community participation shows strong social responsibility"
  ],
  "metadata": {
    "assessment_type": "ai-powered-trust",
    "generated_at": "2024-01-15T10:30:00Z",
    "version": "v2-ai"
  }
}

πŸ₯ Health Check

GET /health

Response:

{
  "status": "healthy",
  "services": {
    "api": "healthy",
    "ai": "ready"
  },
  "timestamp": "2024-01-15T10:30:00Z",
  "uptime": 3600
}

🎨 Frontend Features

πŸ“± Modern React Interface

  • 5-Step Assessment Flow with intuitive UI
  • Real-time AI Processing with progress indicators
  • Detailed Results Display with trust band visualization
  • Improvement Recommendations with actionable steps
  • Responsive Design for mobile and desktop

🎯 User Journey

  1. Purpose Selection - Choose loan type and amount
  2. Behavioral Input - Mobile, utility, community patterns
  3. Evidence Upload - Bills, receipts, payment proofs
  4. Financial Details - Employment and income information
  5. AI Analysis - Real-time processing with 5 AI agents
  6. Results & Guidance - Trust band with improvement roadmap

πŸ”§ Configuration

Environment Variables

# Required
GEMINI_API_KEY=your_gemini_api_key_here

# Optional
PORT=3001
NODE_ENV=development
CORS_ORIGIN=http://localhost:3000

Frontend Configuration

# frontend/.env.local
VITE_GEMINI_API_KEY=your_gemini_api_key_here

πŸ§ͺ Testing

Backend API Testing

# Test trust assessment
curl -X POST http://localhost:3001/api/trust/assess \
  -H "Content-Type: application/json" \
  -d @examples/request-payload.json

# Health check
curl http://localhost:3001/health

Frontend Testing

cd frontend
npm run build
npm run preview

πŸ“Š Sample Results

🌟 T4 - Strong Trust Example

Trust Band: T4 - Strong Trust
Traditional Alignment: 700-749
Confidence: High

Key Strengths:
βœ… 2+ year mobile relationship with consistent patterns
βœ… Perfect utility payment record (always on-time)
βœ… Very active community participation
βœ… Government employment with stable income

Improvement Actions:
πŸ“ˆ Upload 3 more months of evidence β†’ Potential T5 upgrade
πŸ“‹ Add employment certificate β†’ Boost confidence score
⏰ Timeline: 2-3 months for T5 Exceptional Trust

πŸš€ T3 - Developing Trust Example

Trust Band: T3 - Developing Trust  
Traditional Alignment: 650-699
Confidence: Moderate

Key Strengths:
βœ… Good mobile usage consistency
βœ… Generally reliable utility payments
βœ… Active community member

Improvement Actions:
πŸ“± Maintain current payment patterns β†’ Strengthen reliability
πŸ“„ Upload 6 months of comprehensive evidence β†’ Boost to T4
πŸ’Ό Provide income stability documentation β†’ Increase confidence
⏰ Timeline: 3-4 months for T4 Strong Trust

πŸ› οΈ Development

Project Structure

trustweave/
β”œβ”€β”€ src/                    # Backend source
β”‚   β”œβ”€β”€ services/          # AI agents & core services
β”‚   β”œβ”€β”€ routes/            # API endpoints
β”‚   β”œβ”€β”€ middleware/        # Security & validation
β”‚   └── types/             # TypeScript definitions
β”œβ”€β”€ frontend/              # React frontend
β”‚   β”œβ”€β”€ components/        # UI components
β”‚   β”œβ”€β”€ services/          # API clients
β”‚   └── types.ts           # Frontend types
β”œβ”€β”€ database/              # SQL schemas (optional)
β”œβ”€β”€ postman-samples/       # API testing samples
└── examples/              # Request/response examples

Key Technologies

  • Backend: Node.js, Express, TypeScript
  • Frontend: React, TypeScript, Vite
  • AI: Google Gemini 2.0 Flash
  • Security: Helmet, CORS, Rate Limiting
  • Validation: Zod schema validation

🌍 Use Cases

🏦 Financial Institutions

  • Alternative credit scoring for underbanked populations
  • Loan approval automation with AI-powered insights
  • Risk assessment based on behavioral patterns
  • Financial inclusion for emerging markets

🏒 Fintech Companies

  • Digital lending platforms with behavioral analysis
  • Microfinance for small business owners
  • P2P lending with trust-based matching
  • Credit building programs with guidance

🌐 Government & NGOs

  • Financial inclusion initiatives
  • Rural banking programs
  • Policy development based on behavioral insights

🀝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Setup

# Clone repository
git clone https://github.com/20Aarya05/three-point-zero-trustweave.git

# Install dependencies
npm install
cd frontend && npm install

# Start development servers
npm run dev          # Backend on :3001
cd frontend && npm run dev  # Frontend on :5173

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors