Skip to content

isa-group/A-MINT-repo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

A-MINT: Automated Modeling of iPricings from Natural Text

License Python 3.11+ Node 18+ Docker

A-MINT is an advanced artificial intelligence platform that automates the extraction, analysis, and transformation of SaaS pricing information from natural web pages into structured specifications in iPricing YAML format. The system combines advanced web scraping techniques, natural language processing (NLP), and analysis with constraint satisfaction problem (CSP) algorithms to offer a complete pricing management and intelligence solution.

🎯 Main Features

πŸ€– Intelligent AI Processing

  • Automated extraction: Conversion of pricing pages in natural language to structured iPricing YAML specifications
  • Multiple AI providers: Compatible with OpenAI, Gemini, Azure OpenAI and other OpenAI-compatible providers
  • Intelligent validation: Automatic verification and correction of iPricing specifications
  • Semantic alignment: Validation that generated specifications maintain coherence with original content

πŸ” Advanced Pricing Analysis

  • CSP Engine (Constraint Satisfaction Problem): Mathematical analysis of pricing configurations using MiniZinc/Choco
  • Configuration space: Complete enumeration of all possible combinations of plans and add-ons
  • Subscription optimization: Identification of optimal configurations according to specific criteria
  • Smart filtering: Search for configurations that meet specific requirements

🌐 Microservices Architecture

  • A-MINT API: Main pricing transformation engine
  • Analysis API: Specialized service for configuration analysis and validation
  • Web Frontend: Modern and responsive user interface
  • Choco API: Complementary CSP validation service

πŸ—οΈ System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        A-MINT ECOSYSTEM                        β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Frontend (React + Vite)                                       β”‚
β”‚  β”œβ”€ Interactive dashboard                                       β”‚
β”‚  β”œβ”€ Analysis visualization                                     β”‚
β”‚  └─ Pricing file management                                    β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Analysis API (Node.js + TypeScript)                           β”‚
β”‚  β”œβ”€ CSP analysis with MiniZinc                                 β”‚
β”‚  β”œβ”€ iPricing specification validation                           β”‚
β”‚  β”œβ”€ Configuration space calculation                             β”‚
β”‚  └─ Subscription optimization                                  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  A-MINT API (Python + FastAPI)                                 β”‚
β”‚  β”œβ”€ Web data extraction                                        β”‚
β”‚  β”œβ”€ HTML β†’ Markdown β†’ YAML transformation                      β”‚
β”‚  β”œβ”€ YAML validation and correction                             β”‚
β”‚  └─ Multiple AI provider integration                           β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Choco API (Java + Spring Boot)                                β”‚
β”‚  β”œβ”€ Additional CSP specification validation                     β”‚
β”‚  β”œβ”€ Complementary constraint analysis                          β”‚
β”‚  └─ Validation support services                                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Installation and Configuration

Prerequisites

  • Docker & Docker Compose: To run all services
  • Python 3.11+: For local A-MINT engine development
  • Node.js 18+: For local API and frontend development
  • AI API Keys: Gemini, OpenAI or other compatible providers

If installing locally, it is recommended to use docker compose. The Makefile allows you to start all systems easily: make start-api.

Environment Variables Configuration

  1. For any provider compatible with the OpenAI client (we have used Gemini 2.5):
# If you use a single key:
export OPENAI_API_KEY="your-openai-api-key"
# ALTERNATIVE: For automatic rotation of multiple keys:
export OPENAI_API_KEYS="key1,key2,key3"

We got our Gemini API key from Google AI Studio.

  1. Alternatively, you can create a .env file in the root directory based on the provided .env.docker.example file:
cp .env.docker.example .env

Then edit the .env file to add your API keys as explained in the previous step. Only the OPENAI_API_KEY or OPENAI_API_KEYS variable is strictly required.

Docker Installation (Recommended)

# 1. Open the repository
cd A-MINT-repo

# 2. Create Docker network
docker network create a-mint-network

# 3. Start all services
docker compose up --build -d

# 4. Verify all services are running
docker compose ps

Available Services

Once started, you will have access to:

πŸ”§ System Usage

1. Pricing Page Transformation

Via REST API

# Start transformation of a URL
curl -X POST "http://localhost:8001/api/v1/transform" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/pricing",
    "model": "gemini-2.5-flash",
    "max_tries": 50,
    "temperature": 0.7
  }'

2. Pricing Configuration Analysis

Get Pricing Summary

curl -X POST "http://localhost:8002/api/v1/pricing/summary" \
  -F "[email protected]"

Start CSP Analysis

curl -X POST "http://localhost:8002/api/v1/pricing/analysis" \
  -F "[email protected]" \
  -F "operation=optimal" \
  -F "solver=minizinc" \
  -F "objective=minimize"

πŸ“Š Data Structure and Specifications

Feature Types

  • AUTOMATION: Task automation (BOT, FILTERING, TRACKING, TASK_AUTOMATION)
  • DOMAIN: Main domain functionalities
  • GUARANTEE: Technical or service commitments (requires docUrl)
  • INFORMATION: Data and insights exposure
  • INTEGRATION: External integrations (API, EXTENSION, IDENTITY_PROVIDER, WEB_SAAS, MARKETPLACE, EXTERNAL_DEVICE)
  • MANAGEMENT: Administrative functionalities
  • PAYMENT: Payment methods (CARD, GATEWAY, INVOICE, ACH, WIRE_TRANSFER, OTHER)
  • SUPPORT: Customer support and documentation

Usage Limit Types

  • NON_RENEWABLE: One-time limits that don't renew
  • RENEWABLE: Limits that renew according to billing period

Captured Metrics

  • LLM Model Costs: Detailed analysis of expenses by AI provider
  • Token Usage: Tracking of input and output tokens per operation
  • Preprocessing Efficiency: HTML size reduction and cost impact
  • Processing Times: Performance analysis per operation
  • Success Rates: Success and failure statistics of transformations

Specification Validation

The system includes automatic validation at multiple levels:

  1. Syntactic Validation: Valid YAML structure verification
  2. Semantic Validation: iPricing v2.1 specification conformity
  3. CSP Validation: Mathematical constraint coherence
  4. Alignment Validation: Correspondence with original content

πŸ”„ Workflows and Pipelines

Complete Transformation Pipeline

  1. Web Extraction: Intelligent scraping of pricing pages
  2. HTML Preprocessing: Content cleaning and optimization
  3. Markdown Conversion: Structured HTML transformation
  4. Component Extraction: Identification of plans, features and add-ons
  5. YAML Generation: Serialization to iPricing format
  6. Validation and Correction: Automatic verification and corrections
  7. Alignment Analysis: Semantic correspondence validation

CSP Analysis Pipeline

  1. Specification Loading: iPricing YAML file parsing
  2. DZN Conversion: Transformation to MiniZinc format
  3. CSP Resolution: Solver execution to obtain solutions
  4. Post-processing: Result interpretation and formatting
  5. Report Generation: Creation of detailed reports

πŸ“‚ Project Structure

A-MINT/
β”œβ”€β”€ README.md                         # This file
β”œβ”€β”€ LICENSE                          # Project license
β”œβ”€β”€ docker-compose.yml               # Main Docker configuration
β”œβ”€β”€ requirements.txt                 # Main Python dependencies
β”œβ”€β”€ .env.docker.example              # Environment variables example for Docker compose deployment
β”œβ”€β”€ .env.example                     # Environment variables example for local development
β”œβ”€β”€ .gitignore                       # Git ignore file
β”‚
β”œβ”€β”€ src/                            # A-MINT main source code
β”‚   β”œβ”€β”€ amint/                      # Main package
β”‚   β”‚   β”œβ”€β”€ api/                    # FastAPI endpoints
β”‚   β”‚   β”œβ”€β”€ ai/                     # AI clients and configuration
β”‚   β”‚   β”œβ”€β”€ extractors/             # Data extractors
β”‚   β”‚   β”œβ”€β”€ models/                 # Data models
β”‚   β”‚   β”œβ”€β”€ prompts/                # AI prompt templates
β”‚   β”‚   β”œβ”€β”€ transformers/           # Data transformers
β”‚   β”‚   β”œβ”€β”€ utils/                  # General utilities
β”‚   β”‚   └── validators/             # Data validators
β”‚   └── Dockerfile                  # Docker image for A-MINT API
β”‚
β”œβ”€β”€ analysis_api/                   # CSP Analysis API
β”‚   β”œβ”€β”€ src/                        # TypeScript source code
β”‚   β”‚   β”œβ”€β”€ api/                    # API controllers
β”‚   β”‚   β”œβ”€β”€ models/                 # MiniZinc models
β”‚   β”‚   β”œβ”€β”€ services/               # Business logic
β”‚   β”‚   β”œβ”€β”€ types.ts                # Type definitions
β”‚   β”‚   └── utils/                  # Utilities
β”‚   β”œβ”€β”€ tests/                      # Test suite (78 test cases)
β”‚   β”œβ”€β”€ package.json                # Node.js dependencies
β”‚   β”œβ”€β”€ tsconfig.json               # TypeScript configuration
β”‚   └── Dockerfile                  # Docker image
β”‚
β”œβ”€β”€ frontend/                       # React Web Interface
β”‚   β”œβ”€β”€ src/                        # React + TypeScript source code
β”‚   β”‚   β”œβ”€β”€ components/             # Reusable components
β”‚   β”‚   β”œβ”€β”€ pages/                  # Main pages
β”‚   β”‚   β”œβ”€β”€ services/               # API clients
β”‚   β”‚   └── utils/                  # Frontend utilities
β”‚   β”œβ”€β”€ public/                     # Static resources
β”‚   β”œβ”€β”€ package.json                # React dependencies
β”‚   β”œβ”€β”€ tailwind.config.js          # Tailwind CSS configuration
β”‚   β”œβ”€β”€ vite.config.ts              # Vite configuration
β”‚   └── Dockerfile                  # Docker image
β”‚
β”œβ”€β”€ csp/                           # Choco API (Java Spring Boot)
β”‚   β”œβ”€β”€ src/main/                   # Java source code
β”‚   β”œβ”€β”€ pom.xml                     # Maven dependencies
β”‚   └── Dockerfile                  # Docker image

🀝 Contributing

Development Environment Setup

# 1. Open project
cd A-MINT-repo

# 2. Configure environment variables for development
cp .env.example .env
# Edit .env with your API keys

# 3. Install dependencies for local development
pip install -r requirements.txt
cd analysis_api && npm install && cd ..
cd frontend && npm install && cd ..
cd csp && mvn clean install && cd ..

πŸ“š Additional Documentation

APIs and Specifications

πŸ“„ License

This project is licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0). See the LICENSE file for more details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published