A protocol for autonomous LLM agents to navigate web applications via semantic landmarks.
Project description
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
navigatetool 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
remedyandnoise_warningto 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:
- 🏗️ Architecture & Zero-Prompt Vision
- 🌐 Elemm Gateway (Universal Broker)
- 🏥 Agent Repair Kit (Self-Healing)
- 🔒 Security & Session Isolation
- 📊 Case Study: Solaris ERP Benchmark
- 🚢 Deployment Guide
- 🔌 MCP Integration Details
- 🏷️ Decorators API Reference
🎯 Included Examples
Check out the examples/ directory to see Elemm in action:
- Enterprise Hub: The flagship benchmark. A complex forensic audit simulation with 100+ tools.
- Basic Navigation: The "Hello World" showing automatic FastAPI tag discovery.
- Synth-Shop: E-commerce with JWT authentication flows and image rendering.
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file elemm-0.9.0.tar.gz.
File metadata
- Download URL: elemm-0.9.0.tar.gz
- Upload date:
- Size: 51.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4020f20a80d17b415c67ce737b7be7fc5180c2d6a9ea04ca90c0599e6423e4d6
|
|
| MD5 |
3dc759e665933852088fbc9c4cd79fbc
|
|
| BLAKE2b-256 |
cf29eb3e0282618dddceb716294be2e470cde0fe75e9e3c2fe365eb1933d6e24
|
Provenance
The following attestation bundles were made for elemm-0.9.0.tar.gz:
Publisher:
workflow.yml on v3rm1ll1on/elemm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
elemm-0.9.0.tar.gz -
Subject digest:
4020f20a80d17b415c67ce737b7be7fc5180c2d6a9ea04ca90c0599e6423e4d6 - Sigstore transparency entry: 1364622032
- Sigstore integration time:
-
Permalink:
v3rm1ll1on/elemm@3e44aa592c4ec49a95c687461b7df31dbe7bcef3 -
Branch / Tag:
refs/tags/v0.9.0 - Owner: https://github.com/v3rm1ll1on
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@3e44aa592c4ec49a95c687461b7df31dbe7bcef3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file elemm-0.9.0-py3-none-any.whl.
File metadata
- Download URL: elemm-0.9.0-py3-none-any.whl
- Upload date:
- Size: 45.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75d7a0dde461316ee0be88a633cd0d5b92cc7d1ff3087bf00f63ba04f99afa5b
|
|
| MD5 |
ca3c509d930d79fc091c95958517b5e3
|
|
| BLAKE2b-256 |
72ea95a42c611d84aeb314acf169d933f5a632a7e5ae3877e5e5a52fbbcff706
|
Provenance
The following attestation bundles were made for elemm-0.9.0-py3-none-any.whl:
Publisher:
workflow.yml on v3rm1ll1on/elemm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
elemm-0.9.0-py3-none-any.whl -
Subject digest:
75d7a0dde461316ee0be88a633cd0d5b92cc7d1ff3087bf00f63ba04f99afa5b - Sigstore transparency entry: 1364622054
- Sigstore integration time:
-
Permalink:
v3rm1ll1on/elemm@3e44aa592c4ec49a95c687461b7df31dbe7bcef3 -
Branch / Tag:
refs/tags/v0.9.0 - Owner: https://github.com/v3rm1ll1on
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@3e44aa592c4ec49a95c687461b7df31dbe7bcef3 -
Trigger Event:
push
-
Statement type: