LlamaIndex Plasmate Reader
A LlamaIndex reader for Plasmate SOM (Structured Object Model), providing clean, structured web content optimized for AI agents and RAG pipelines.
What is Plasmate SOM?
Plasmate SOM converts messy HTML into a clean, semantic structure that AI models can easily understand. Instead of parsing raw HTML with all its noise, you get structured content with:
- Semantic regions (headers, navigation, main content, footers)
- Clean text extraction from headings, paragraphs, links, lists, and tables
- Compression ratios typically 10x smaller than raw HTML
- Consistent structure across any website
Installation
pip install llama-index-readers-plasmate
Quick Start
from llama_index_plasmate import PlasmateReader
# Initialize the reader
reader = PlasmateReader()
# Load documents from URLs
documents = reader.load_data(urls=[
"https://example.com/page1",
"https://example.com/page2",
])
# Use with LlamaIndex
from llama_index.core import VectorStoreIndex
index = VectorStoreIndex.from_documents(documents)
query_engine = index.as_query_engine()
response = query_engine.query("What is on these pages?")
Configuration
Using the SOM Cache API (Recommended)
The reader uses the Plasmate SOM Cache API by default for fast, cached responses:
reader = PlasmateReader(
api_key="your-api-key", # Optional, for authenticated access
api_base="https://cache.plasmate.app", # Default
)
Using Local Plasmate CLI Fallback
If the API is unavailable, the reader automatically falls back to the local plasmate CLI if installed:
# Install plasmate CLI
npm install -g plasmate
The reader will use the CLI when:
- The API returns an error
- No API key is provided and the endpoint requires authentication
- You explicitly disable the API
Document Metadata
Each document includes rich metadata:
doc = documents[0]
print(doc.metadata)
# {
# "source": "https://example.com/page1",
# "title": "Page Title",
# "som_version": "1.0",
# "compression_ratio": 12.5,
# "html_bytes": 125000,
# "som_bytes": 10000,
# }
API Reference
PlasmateReader
PlasmateReader(
api_key: Optional[str] = None,
api_base: str = "https://cache.plasmate.app",
)
Parameters:
api_key: Optional API key for authenticated access to the SOM Cache APIapi_base: Base URL for the SOM Cache API (default:https://cache.plasmate.app)
load_data
reader.load_data(
urls: List[str],
) -> List[Document]
Parameters:
urls: List of URLs to fetch and convert to documents
Returns:
List of LlamaIndex Document objects with extracted text and metadata.
How It Works
- The reader sends URLs to the Plasmate SOM Cache API
- Plasmate fetches the page and converts HTML to SOM format
- The reader extracts readable text from semantic regions:
- Headings (h1 through h6)
- Paragraphs
- Links (with href context)
- Lists (ordered and unordered)
- Tables
- Text is assembled into a clean document with source metadata
Links
License
Apache 2.0
Metadata
Release files for llama-index-readers-plasmate 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| llama_index_readers_plasmate-0.1.0.tar.gz | 9.6 kB | Without provenance | Details for llama_index_readers_plasmate-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| llama_index_readers_plasmate-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for llama_index_readers_plasmate-0.1.0-py3-none-any.whl |
Total release size: 18.8 kB
Release files / llama_index_readers_plasmate-0.1.0.tar.gz
| Download URL | llama_index_readers_plasmate-0.1.0.tar.gz |
|---|---|
| Size | 9.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1d74334631853c023170dca46780b7d186c96931bc9ba806c2e11e36668fbc22
|
|
BLAKE2b-256 checksum How to use checksums |
7b290e183fb8e4af0612c30ea06c7b73dd71ad5e626e62a7f31ab6305b1cc3ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / llama_index_readers_plasmate-0.1.0-py3-none-any.whl
| Download URL | llama_index_readers_plasmate-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0d0c0edeb038faa4ba06b3e135ef078933c378388da9639d02d1b10698007261
|
|
BLAKE2b-256 checksum How to use checksums |
ca8392a9710697dacf3b63b7204626de93f4595e0e594115cf5fcd8fd9773cd3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Security for llama-index-readers-plasmate 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.