SLIM Protocol Documentation
Everything you need to integrate AI-optimized content in your projects
What is SLIM?
SLIM Protocol
SLIM (Structured Lightweight Information Markup) is an AI-native content protocol that transforms web content into a hierarchical format optimized for Large Language Models.
Why SLIM?
Traditional HTML pages contain 80-95% noise (ads, navigation, scripts). SLIM extracts only the semantic content, reducing token usage by 90%+ while improving AI comprehension.
How it works
SLIM uses a pyramid structure (L1-L7) where each level provides progressively more detail. AI agents can request only the level they need, saving tokens and improving response quality.
SLIM-PYRAMID Levels
Content is organized in hierarchical levels, from identity to full content:
Title, type, source URL. ~30 tokens. Use for routing decisions.
Sections, outline, metadata. ~150 tokens. Use for understanding scope.
Main facts, summaries, highlights. ~500 tokens. Use for most queries.
Complete semantic content. Variable size. Use when detail is needed.
MCP Server for Claude Desktop
Use SLIM directly in Claude Desktop through Model Context Protocol. Claude will automatically fetch and process web content in SLIM format.
1. Install the MCP server globally:
npm install -g @slim-protocol/mcp-server
2. Add to Claude Desktop config (~/.config/claude/config.json):
{
"mcpServers": {
"slim": {
"command": "slim-mcp-server",
"env": {
"SWR_PROXY_URL": "https://swrproxy.frux.pro"
}
}
}
}3. Restart Claude Desktop. Now you can ask Claude to fetch any URL!
"Hey Claude, fetch the SLIM for https://en.wikipedia.org/wiki/Artificial_intelligence"
TypeScript / JavaScript SDK
Zero-dependency client that works in Node.js and browsers. Fully typed with TypeScript.
Installation
npm install @slim-protocol/client
Basic Usage
import { fetchSlim } from '@slim-protocol/client';
const result = await fetchSlim('https://example.com');
if (result.success) {
console.log(result.data.pyramid.L1); // Identity
console.log(result.data.pyramid.L3); // Structure
console.log(result.data.pyramid.L5); // Key points
}Advanced Options
const result = await fetchSlim('https://example.com', {
level: 'L5', // Request specific level
includeImages: true, // Process images
includeVideos: false, // Skip videos
timeout: 30000, // Custom timeout
});Python SDK
Full-featured Python client with sync and async support. Includes integrations with popular AI frameworks.
Installation
# Basic installation pip install slim-protocol # With LangChain support pip install slim-protocol[langchain] # With LlamaIndex support pip install slim-protocol[llamaindex] # All integrations pip install slim-protocol[all]
Basic Usage
from slim_protocol import fetch_slim
result = fetch_slim("https://example.com")
if result.success:
print(result.data.pyramid.L1) # Identity
print(result.data.pyramid.L5) # Key pointsLangChain Integration
from slim_protocol.integrations.langchain import SlimLoader
loader = SlimLoader(urls=[
"https://example.com/page1",
"https://example.com/page2",
])
documents = loader.load()
# Use with any LangChain chain
from langchain.chains import RetrievalQA
# ...LlamaIndex Integration
from slim_protocol.integrations.llamaindex import SlimReader
reader = SlimReader()
documents = reader.load_data(urls=[
"https://example.com/page1",
])
# Use with LlamaIndex
from llama_index import VectorStoreIndex
index = VectorStoreIndex.from_documents(documents)WordPress Plugin
Enable native SLIM support on your WordPress site. Your content becomes AI-friendly without any code changes.
Features
- Discovery endpoint at /.well-known/slim
- REST API for SLIM content
- Automatic SLIM generation for all posts and pages
- Response caching for optimal performance
Installation
1. Download the plugin from GitHub
2. Upload to /wp-content/plugins/
3. Activate in WordPress Admin → Plugins
4. Configure in Settings → SLIM Protocol
Direct API Access
You can also use the SWR Proxy API directly without any SDK:
Endpoint
GET https://swrproxy.frux.pro/swr?url={URL}Parameters
| Parameter | Type | Description |
|---|---|---|
url | string | URL to transform (required) |
level | L1|L3|L5|L7 | Maximum level to return |
images | boolean | Include image processing |
videos | boolean | Include video processing |
Response
{
"swrVersion": "1.0",
"source": {
"url": "https://example.com",
"fetchedAt": "2024-01-27T12:00:00Z"
},
"payload": {
"pyramid": {
"L1": { "title": "...", "type": "article" },
"L3": { "sections": [...], "outline": "..." },
"L5": { "keyPoints": [...], "summary": "..." },
"L7": { "fullContent": "..." }
}
}
}Try it now in the Playground