Skip to main content

A protocol for autonomous LLM agents to navigate web applications via semantic landmarks.

Project description

Elemm: LLM Landmark Protocol

Hierarchical API Discovery for Enterprise AI Agents

PyPI version License: GPL v3 Python 3.10+


Elemm is a protocol standard for the Model Context Protocol (MCP) and FastAPI. It replaces overwhelming flat API tool lists with a hierarchical, navigable structure (Landmarks). This allows AI agents to efficiently explore and interact with massive enterprise APIs without context window overflows, reducing token consumption by up to 80% while significantly increasing reliability.

Why Elemm?

Modern AI agents struggle when presented with hundreds of tools simultaneously. The context window fills up, cognitive latency spikes, and hallucinations become frequent.

Elemm solves this by introducing Landmarks:

  • Semantic Signposts: Group your tools into logical domains (e.g., IT, HR, Finance).
  • Just-in-Time Context: The agent uses the navigate tool to switch modules. Elemm dynamically injects only the tools relevant to the current module into the agent's toolbelt.
  • Zero-Prompt Vision: Stop writing massive system prompts. The protocol acts as its own documentation, guiding the agent automatically.

Core Features

  • Hierarchical Navigation: Transforms flat APIs into a navigable tree structure.
  • Extreme Token Efficiency: Cuts token usage per step by up to 80%, enabling complex operations even on smaller local models (e.g., Gemma 4).
  • Agent Repair Kit: Real-time self-healing. When the AI makes an error (e.g., HTTP 422), Elemm injects a dynamic remedy and noise_warning to guide self-correction without permanently polluting the context.
  • Hybrid Auto-Scaling: Automatically flattens small toolsets (<10 tools) to eliminate navigation overhead for simple tasks.
  • Enterprise Security: Context-aware tool validation, read-only modes, and strict session isolation for multi-agent environments.
  • Native MCP Bridge: Full integration with the Model Context Protocol via Stdio and SSE.

Quick Start

Installation

# Core package (Native Python, Framework-Agnostic)
pip install elemm

# With FastAPI integration
pip install elemm[fastapi]

Option A: Native Python (Framework-Agnostic)

Turn any Python module into a hierarchical MCP server without needing a web framework.

import asyncio
from elemm.core.manager import BaseAIProtocolManager
from elemm.mcp.bridge import LandmarkBridge
import my_tools_module # Your file containing @manager.tool decorated functions

manager = BaseAIProtocolManager(agent_instructions="You are an AI assistant.")

# Auto-discover and register native python functions
manager.bind_module(my_tools_module)

# Create the MCP bridge and expose via Stdio
bridge = LandmarkBridge(manager=manager)
# You can now connect this to any MCP client!

Option B: FastAPI Integration

Turn any FastAPI application into a hierarchical MCP server with just a few decorators.

from fastapi import FastAPI
from elemm.integrations.fastapi.manager import FastAPIProtocolManager as Elemm

app = FastAPI()
ai = Elemm(agent_instructions="You are an IT Support Agent. Navigate landmarks to find tools.")

# 1. Define a Landmark (Entry Point)
@app.get("/it/ops")
@ai.landmark(id="it_ops", type="navigation")
async def it_portal():
    return {"status": "IT Operations Active"}

# 2. Register a Tool within that module
@app.post("/it/restart")
@ai.action(id="restart_node", groups=["it_ops"], remedy="Ensure node_id format is SRV-XXXX.")
async def restart(node_id: str):
    return {"result": f"Node {node_id} restarted."}

# 3. Bind everything to the app
ai.bind_to_app(app)

# 4. Expose via Stdio (CLI) or SSE (Web)
# Stdio: Run directly via `python app.py` (if script uses `run_mcp_stdio`)
# SSE: Connect your agent via HTTP
ai.bind_mcp_sse(app, route_prefix="/mcp")

Agent-Side Connection

Connect Claude Desktop, LangChain, or any MCP-compatible agent!

Local (Stdio):

{
  "mcpServers": {
    "my-enterprise-api": {
      "command": "python",
      "args": ["path/to/your/app.py"]
    }
  }
}

Remote (SSE): Simply point your agent to http://your-api.com/mcp/sse.


Deep Dive Documentation

Explore our comprehensive guides to master Elemm:


Included Examples

Check out the examples/ directory to see Elemm in action:

  1. Enterprise Hub: The flagship benchmark. A complex forensic audit simulation with 100+ tools.
  2. Basic Navigation: The "Hello World" showing automatic FastAPI tag discovery.
  3. Synth-Shop: E-commerce with JWT authentication flows and image rendering.
  4. Office Management: Booking automation with location-based navigation.

Contributing & License

Elemm is open-source and built for the community. Licensed under the GNU General Public License v3.0. Created by Marc Stöcker.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

elemm-0.9.3.tar.gz (52.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

elemm-0.9.3-py3-none-any.whl (51.6 kB view details)

Uploaded Python 3

File details

Details for the file elemm-0.9.3.tar.gz.

File metadata

  • Download URL: elemm-0.9.3.tar.gz
  • Upload date:
  • Size: 52.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for elemm-0.9.3.tar.gz
Algorithm Hash digest
SHA256 8287799d9ae51ca8a43b0d6b4fb9f40135d991482d3e6955091bd0c684cb7d90
MD5 1b26982069e8d831a01b684f65052c66
BLAKE2b-256 9e708b1c571667da66216583dfcdd039d4f0de180838c7aa39cc36ef22c6ccfa

See more details on using hashes here.

Provenance

The following attestation bundles were made for elemm-0.9.3.tar.gz:

Publisher: workflow.yml on v3rm1ll1on/elemm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file elemm-0.9.3-py3-none-any.whl.

File metadata

  • Download URL: elemm-0.9.3-py3-none-any.whl
  • Upload date:
  • Size: 51.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for elemm-0.9.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a34ca6d473a009d57f5a4f7c4d57afb09e2c1e6c02031d3d0b69834ae47ba8c3
MD5 756910452278b283a4e532b5d4cf5eb8
BLAKE2b-256 2d82a4711a00dfecc7f2ae6a84a3afaf01de3c5a860768a537ff6a59809d120e

See more details on using hashes here.

Provenance

The following attestation bundles were made for elemm-0.9.3-py3-none-any.whl:

Publisher: workflow.yml on v3rm1ll1on/elemm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page