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
-
Clone the repository
git clone https://github.com/stepfnAI/mapping_agent.git cd mapping_agent git switch main
-
Install dependencies
uv sync --extra dev source .venv/bin/activate
-
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_promptconstructs 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.
Metadata
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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mapping_agent-0.1.2.tar.gz | 12.2 kB | Without provenance | Details for mapping_agent-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mapping_agent-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for mapping_agent-0.1.2-py3-none-any.whl |
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
|
Security for mapping-agent 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.