Skip to content

Repository files navigation

LADM Composer

An open-source tool for creating Land Administration Domain Model (LADM) country profiles based on ISO 19152:2024/2025.

Overview

LADM Composer is a web application that helps users design LADM-based country profiles. The application combines Azure OpenAI with Pydantic AI for intelligent analysis and UML diagram generation, PlantUML for diagrams, and provides an intuitive Streamlit-based interface.

Tech Stack

  • Frontend: Streamlit (Python web framework)
  • AI: Azure OpenAI (GPT models) with Pydantic AI
  • Diagrams: PlantUML
  • Memory: Hindsight MCP server (optional)
  • Database: SQL (PostgreSQL, MySQL), MIM XML
  • Container: Docker

Quick Start

Prerequisites

  • Docker
  • Docker Compose
  • Azure OpenAI API key

Running

# Build and start the container
docker-compose up -d --build

# View logs
docker logs ladm-composer-ladm-assessment-1

# Stop
docker-compose down

The application runs at http://localhost:8008

Configuration

Create a .env file in the project root with the following variables:

# Azure OpenAI configuration
AZURE_OPENAI_API_KEY=your_key
AZURE_OPENAI_ENDPOINT=your_endpoint
AZURE_OPENAI_DEPLOYMENT=gpt-5.4

# Optional: model settings
MAX_TOKENS=50000
OPENAI_MAX_TOKENS=128000
OPENAI_REASONING_EFFORT=medium

# Optional: Hindsight memory service via MCP
# Make sure the Hindsight MCP server is running at the specified address
HINDSIGHT_MCP_URL=http://hindsight:8888/mcp

Note: If HINDSIGHT_MCP_URL is not set, the application will work without Hindsight memory functionality.

Available Pages

  • About: Project information
  • Assessment: Upload documents for LADM analysis
  • Questions: Answer questionnaire about country profile
  • UML: Generate PlantUML diagrams
  • Output: View analysis results
  • Chat: Interactive LADM profile designer
  • Report: Generate PDF report
  • Files: Manage uploaded files
  • Config: Azure configuration

Project Structure

ladm-composer/
├── llmapp.py           # Main entry point (Streamlit app)
├── views/              # Streamlit pages
│   ├── chat.py         # Chat interface for LADM profile design
│   ├── home.py         # Home page for document analysis
│   ├── uml.py          # UML diagram generation
│   ├── assessment.py   # Document upload and analysis
│   ├── report.py       # PDF report generation
│   └── ...
├── src/                # Core modules
│   ├── llm.py          # LLM initialization and Pydantic AI agent
│   ├── plantuml.py     # PlantUML encoding and image fetching
│   ├── helpers.py      # Helper functions
│   └── pdf.py          # PDF generation
├── models/             # Pydantic data models
├── skills/             # LADM ISO skills for AI
├── data/               # Sample data
├── requirements.txt    # Python dependencies
├── Dockerfile
├── docker-compose.yaml
├── .env                # Environment variables (not in repo)
├── README.md           # This file (English)
└── README.nl.md        # Dutch version

Development

Local Testing

For local testing without Docker:

# Install dependencies
pip install -r requirements.txt

# Start the app
streamlit run llmapp.py

Docker Rebuild

After code changes:

docker-compose build --no-cache ladm-assessment
docker-compose restart

MCP Integration (Hindsight)

LADM Composer supports the Hindsight MCP server for memory and context functionality. The integration uses MCPServerStreamableHTTP as a toolset in Pydantic AI.

Benefits of the MCP approach:

  • Simpler configuration via a single URL
  • Automatic timeout handling by Pydantic AI
  • Standard MCP protocol for better interoperability
  • No extra packages required

Troubleshooting

Container not running

docker-compose down
docker-compose up -d --build
docker logs ladm-composer-ladm-assessment-1

Hindsight MCP server not reachable

  • Check if the Hindsight server is running
  • Check HINDSIGHT_MCP_URL in your .env file
  • The application works without Hindsight if the server is not available

PDF generation errors

  • Make sure all text is properly sanitized
  • Check logs for Unicode error messages

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages