Skip to content

lewisawe/biasharaAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Biashara Act 🌟

AI-Powered Financial Inclusion for Kenya's Informal Economy

Transform spoken transactions into verified financial records using Amazon Nova AI, enabling informal traders to build credit histories and access formal banking services.

The Problem

83% of Kenya's workforce (14M+ people) operates in the informal economy, conducting millions of shillings in daily transactions. Despite this economic activity, they lack formal financial records, making them "unbankable" and unable to access credit for business expansion.

The Solution

Biashara Act uses multiple Amazon Nova capabilities:

  1. 🤖 Agentic AI — Nova 2 Lite with tool-use parses transactions, validates numbers, categorizes the business, and assesses profitability in a multi-step agent loop
  2. 📷 Multimodal Understanding — Nova 2 Lite vision parses photos of handwritten receipts and transaction records
  3. 🖥️ UI Automation — Nova Act automates data entry into Wave Accounting for formal bookkeeping
  4. 📊 Credit Scoring — Algorithm calculates loan readiness from transaction history

Quick Start

Backend

cd backend
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
# Edit .env with your AWS credentials
python app.py

Frontend

cd frontend
npm install
npm run dev

Open http://localhost:3000

Amazon Nova Integration

1. Agentic AI — Multi-Step Tool Use (Nova 2 Lite)

The parser uses the Converse API with toolConfig to run a multi-step agent loop:

User Input → Nova 2 Lite Agent
  ├── Tool: validate_transaction (fix quantity × price = total)
  ├── Tool: categorize_business (classify by items traded)
  └── Tool: assess_profitability (margin analysis + advice)
→ Validated transactions + business insights

Nova decides which tools to call and in what order. The agent loop continues until all tools have been used and a final summary is generated.

2. Multimodal Understanding (Nova 2 Lite Vision)

Upload a photo of a handwritten receipt → Nova extracts structured transaction data:

response = bedrock.converse(
    modelId='us.amazon.nova-2-lite-v1:0',
    messages=[{
        'role': 'user',
        'content': [
            {'image': {'format': 'jpeg', 'source': {'bytes': image_data}}},
            {'text': 'Extract transactions from this receipt...'}
        ]
    }]
)

3. UI Automation (Nova Act)

Automates entry of transactions into Wave Accounting:

with NovaAct(starting_page="https://my.waveapps.com/login", headless=True) as nova:
    nova.act("Navigate to Transactions page")
    nova.act("Click 'Add Income' button")
    nova.act(f"Fill in description: Sale: pineapples x40")
    nova.act(f"Set amount to 2400")
    nova.act("Click Save")

API Endpoints

Method Endpoint Description Nova Feature
POST /api/parse Parse text with agentic tool-use Agentic AI
POST /api/parse-image Parse receipt photo Multimodal
POST /api/bookkeep Automate Wave entry Nova Act
GET /api/dashboard Dashboard data
GET /api/credit-score Credit score
GET /api/report Financial report

Project Structure

biashara-act/
├── backend/
│   ├── app.py                  # Flask API
│   ├── nova_parser.py          # Agentic parser + multimodal (Nova 2 Lite)
│   ├── nova_act_bookkeeper.py  # UI automation (Nova Act)
│   ├── mock_data.py            # Mock transactions & scoring
│   └── requirements.txt
├── frontend/
│   ├── src/
│   │   ├── App.jsx             # Dashboard with text + image input
│   │   ├── main.jsx
│   │   └── index.css
│   ├── package.json
│   └── vite.config.js
└── README.md

Hackathon Categories

  • Agentic AI — Multi-step tool-use agent loop with validate → categorize → assess
  • Multimodal Understanding — Receipt image parsing with Nova vision
  • UI Automation — Nova Act automates Wave Accounting data entry
  • Freestyle — Financial inclusion for 14M+ informal traders

Credit Scoring

Factor Weight Description
Consistency 40% Months of transaction history
Profitability 30% Profit margins
Verification 20% M-Pesa verified transactions
Volume 10% Total revenue

Grades: A (80-100) Loan Ready · B (60-79) Almost There · C (40-59) Building History · D (0-39) Keep Recording

Configuration

# Required
AWS_REGION=us-east-1
AWS_ACCESS_KEY_ID=...
AWS_SECRET_ACCESS_KEY=...

# Optional: Nova Act bookkeeping
NOVA_ACT_API_KEY=...
WAVE_EMAIL=...
WAVE_PASSWORD=...

Without NOVA_ACT_API_KEY, the bookkeeping endpoint returns simulated results for demo purposes.


Built for Amazon Nova AI Hackathon 2026

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages