Skip to main content

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

Project description

Elemm (Landmark Protocol)

The Universal AI-Native Backend Bridge. Turn any API into resilient, autonomous AI tools in seconds.

Elemm is a high-performance framework centered around the Model Context Protocol (MCP). It transforms standard REST endpoints into "AI Landmarks", enabling autonomous agents (like Claude or GPT) to discover and interact with your backend with zero-shot precision and self-healing resilience.


Why Elemm? (The Problem with Flat APIs)

Traditional APIs (OpenAPI/Swagger) are built for humans. When you feed a 200-endpoint Swagger file to an LLM:

  1. Context Overload: The agent drowns in noise (HTTP codes, headers, internal types).
  2. Token Waste: Every turn costs thousands of tokens just for tool descriptions.
  3. Fragility: If the AI makes one typo in a parameter, it gets a raw 400 error and gives up.

Elemm solves this with the Landmark-Architecture.

Feature Standard OpenAPI Native MCP (Flat) Elemm (Landmarks)
Noise Level High (HTTP Metadata) Medium (Flat-List) Low (Context Isolated)
Discovery Static (Manual) Static (Full Load) Hierarchical (Drill-Down)
Error Handling Generic 4xx/5xx RAW Error Agent-Repair-Kit (Self-Healing)
Security Manual Header Logic Manual Zero-Config (Auto-Shield)
Max Scale Limited by Context ~50 Tools Unlimited (Scale out)
Token Cost factor 5x factor 1x factor < 0.1x (Hygiene)

📚 Documentation Index

For deep dives into the protocol's power, see our specialized guides:


Key Features

1. Agent-Repair-Kit (Self-Healing)

Elemm is the first protocol that actively talks back to the AI when things go wrong.

  • Automated Remedies: If a validation fails (422), Elemm injects your custom remedy instructions into the error response.
  • Noise Detection: It explicitly warns the agent if it's hallucinating parameters that don't exist in the manifest.
  • Instructional Loops: The AI receives a "behebbar" (fixable) JSON that guides it back to the successful call.

2. Hierarchical Navigation (Context Hygiene)

Stop loading the full API at once. Elemm uses a "Drill-Down" flow:

  • Signposts: The agent only sees the "Main Entries" (e.g., explore_logistics, explore_billing).
  • Module Loading: Only when the agent enters a module are the specific tools revealed.
  • Token Efficiency: This reduces the active context size by up to 90%.

3. Managed Security (Auto-Shield)

Elemm auto-detects HTTPBearer, APIKey, and OAuth2 dependencies.

  • Technical credentials are hidden from the agent.
  • The protocol marks them as managed_by: protocol.
  • Read-Only Mode: Protect your production with a single flag (LANDMARK_READ_ONLY=True) which strips all state-changing actions from the manifest.

Quick Start

1. Installation

pip install elemm

2. Implementation

from elemm import Elemm
from fastapi import FastAPI
from pydantic import BaseModel, Field

app = FastAPI()
ai = Elemm(agent_welcome="Welcome to Solaris-OS.")

class Order(BaseModel):
    item_id: str
    amount: int = Field(..., ge=1, le=100)

@ai.tool(id="get_categories", type="navigation")
@app.get("/categories")
async def list_cats():
    """Discover available product modules."""
    return ["Electronics", "Books"]

@ai.action(
    id="place_order", 
    remedy="Always provide an amount between 1 and 100."
)
@app.post("/order")
async def order(data: Order):
    return {"status": "success"}

# Bind everything
ai.bind_to_app(app)

Decorator Reference

Use the decorators that fit your naming convention – they are all functionally identical aliases of @ai.landmark:

  • @ai.tool(id=...): Best for OpenAI / LangChain style.
  • @ai.action(id=...): Standard for API-centric logic.
  • @ai.landmark(id=...): The precise term for semantic navigation.

Key Options:

  • id (Required): The unique name of the tool for the AI.
  • type (Default: "read"/"write"): "read", "write", or "navigation".
  • remedy: The instruction given to the AI if it fails the validation.
  • instructions: Specific rules for this tool (e.g., "Ask for approval first").
  • global_access: If True, this tool stays visible even deep inside other modules.

Native MCP Support

Elemm isn't just a manifest; it's a bridge. Use the built-in MCP Server to connect your entire API directly to Claude Desktop, Cursor, or LibreChat.

Claude Desktop Integration

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "my-backend": {
      "command": "python3",
      "args": ["/path/to/your/app.py"],
      "env": { "LANDMARK_URLS": "http://localhost:8000" }
    }
  }
}

Architecture & Resilience

Elemm is built for scale.

  • Reverse Proxy Support: Automatically respects root_path (Nginx/Traefik).
  • Circular Ref Safety: Handles complex Pydantic models (self-referencing models).
  • ID Sanitization: Safely handles special characters in tags and module names.

📄 License

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.5.2.tar.gz (33.2 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.5.2-py3-none-any.whl (26.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for elemm-0.5.2.tar.gz
Algorithm Hash digest
SHA256 af9f08e09ffa5e26073f1ab3d8effa88396699d2d5b826b5a3ba73551b1b3350
MD5 3c45e6b357c3f19879a4870d59810aee
BLAKE2b-256 9dba0d33d7fecf36a1856bd246946446a049973bd2c4e92a9b1ce86a0e1ecbeb

See more details on using hashes here.

Provenance

The following attestation bundles were made for elemm-0.5.2.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.5.2-py3-none-any.whl.

File metadata

  • Download URL: elemm-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 26.4 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.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1f586cdd6b233f93119119fdcf3279f61c6f125cfc1567e3836bd67f4b8a4117
MD5 cec02b5f8228d2ecfc8a6bd404c963e2
BLAKE2b-256 a6520d2a0f94023e0960b35fa2f0b0244208059bbc131aa7d92f5be83e3b6d42

See more details on using hashes here.

Provenance

The following attestation bundles were made for elemm-0.5.2-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