Skip to main content

Mapping Agent

LLM-driven intelligent attribute-to-column mapping agent for domain schema validation and refinement.


🌟 Features

  • Intelligent Entity Mapping – Uses LLM reasoning to map entities from a domain schema to columns across multiple tables.
  • Confidence Scoring – Provides confidence scores for each mapping.
  • Transformation Suggestions – Suggests data transformations for better alignment.
  • Context-Aware Analysis – Generates column profiles (types, nulls, uniqueness, distributions) to improve mapping accuracy.

🚀 Quick Start

Installation

Prerequisites

  • uv – package & environment manager
    Please refer to the official installation guide for the most up-to-date instructions.
    For quick setup on macOS/Linux, you can currently use:
    curl -LsSf https://astral.sh/uv/install.sh | sh
    
  • Git

Steps

  1. Clone the repository

    git clone https://github.com/stepfnAI/mapping_agent.git
    cd mapping_agent
    git switch main
    
  2. Install dependencies

    uv sync --extra dev
    source .venv/bin/activate
    
  3. Set environment variables
    The agent requires an API key (e.g., OpenAI).

    export LLM_PROVIDER="your-llm-provider"   #"openai/anthropic"
    export LLM_MODEL="your-llm-model"         #"gpt-4.1-mini"
    export LLM_API_KEY="your-api-key-here"    
    

Basic Usage

Example: Mapping the Borrower Profile entity to columns across two CSV files.

python examples/basic_usage.py

🧪 Testing

Run the test suite with pytest:

# Run all tests
pytest tests/ -s

# Run with coverage
pytest tests/test_models.py
pytest tests/test_utils.py
pytest tests/test_agent_integration.py

📝 Prompt Management

Prompts are centralized in
src/mapping_agent/constants.py.

  • format_mapping_prompt_with_system_prompt constructs structured prompts with a system message.
  • Ensures the LLM consistently acts as a data mapping expert.
  • Easy to extend or fine-tune reasoning strategies in one place.

🤝 Contributing

Contributions are welcome!
Please see the Contributing Guide before submitting a PR.


📄 License

Licensed under the MIT License. See LICENSE for details.

Release files for mapping-agent 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mapping-agent 0.1.2
File Size Uploaded
mapping_agent-0.1.2.tar.gz 12.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mapping-agent 0.1.2
File Interpreter ABI Platform
mapping_agent-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 21.4 kB

Release files / mapping_agent-0.1.2.tar.gz

Download URL mapping_agent-0.1.2.tar.gz
Size 12.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c58c20c82a2ca88df4a537da295bc071097ef9130871214266281bbb108c018d
BLAKE2b-256 checksum
How to use checksums
8ef3b4bd03d6583a35f340bbb7df4b6957c2ebd23b56e057d75872618e4a03e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.22

Release files / mapping_agent-0.1.2-py3-none-any.whl

Download URL mapping_agent-0.1.2-py3-none-any.whl
Size 9.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
01909ee1e2ded6016706401010d9f821f39c3445a3acc83ad2cb458ba858e8c1
BLAKE2b-256 checksum
How to use checksums
ba6e364188699469109709eff040aa5b87f66a666b28d732a3629ec4f8079dad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.22

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page