Heroku for ML Features
Project description
Meridian
The Context Store for LLMs & ML Features
Define RAG pipelines and ML features in Python. Get production retrieval, vector search, and training data for free.
Stop fighting the infrastructure tax. Meridian takes you from "Notebook Prototype" to "Production RAG" in 30 seconds.
📚 Documentation | 🤖 Context Store | 🛠️ Testing Guide
🚀 Why Meridian?
Most feature stores are built for the 1% of companies (Uber, DoorDash) with platform teams. They require Kubernetes, Spark, and complex microservices.
Meridian is built for the rest of us.
| Feature | The "Old Way" | The Meridian Way |
|---|---|---|
| Config | 500 lines of YAML | Python Decorators (@feature) |
| Infra | Kubernetes + Spark | Runs on your Laptop (DuckDB) |
| Serving | Complex API Gateway | meridian serve file.py |
| RAG Context | LangChain Spaghetti | Declarative @context |
| Philosophy | "Google Scale" | "Get it Shipped" |
⚡ The 30-Second Quickstart
1. Install
pip install "meridian-oss[ui]"
2. Define Features & Context (features.py)
from meridian.core import FeatureStore, entity, feature
from meridian.context import context, ContextItem
from meridian.retrieval import retriever
import random
store = FeatureStore()
@entity(store)
class User:
user_id: str
# 1. THE FEATURE STORE (Structured Data)
@feature(entity=User, refresh="daily", materialize=True)
def user_tier(user_id: str) -> str:
# Imagine a DB lookup here; we'll simulate it for speed.
return "premium" if hash(user_id) % 2 == 0 else "free"
# 2. THE CONTEXT STORE (Unstructured Data)
@retriever(store)
async def find_docs(query: str):
# In production, this uses pgvector.
# Here we simulate a semantic search result.
return [{"content": "Meridian bridges the gap between ML features and RAG.", "score": 0.9}]
# 3. THE UNIFICATION (Context Assembly)
@context(store)
async def build_prompt(user_id: str, query: str):
# Fetch feature and docs in parallel
tier = await store.get_feature("user_tier", user_id)
docs = await find_docs(query)
return [
ContextItem(f"User is {tier}. Adjust tone accordingly.", priority=0),
ContextItem(str(docs), priority=1)
]
3. Use in Your App
import asyncio
from features import build_prompt
async def main():
ctx = await build_prompt(user_id="u1", query="How does Meridian help?")
print(ctx.items)
# Output: [ContextItem(content='User is free...', ...), ContextItem(content='[{"content":...}]', ...)]
if __name__ == "__main__":
asyncio.run(main())
4. Serve (Optional) Expose features via HTTP for non-Python apps:
meridian serve features.py
# 🚀 Server running on http://localhost:8000
🛠️ Key Capabilities
Meridian bridges the gap between AI Engineers building RAG agents and ML Engineers training models.
🤖 For AI Engineers (The Context Store)
- Vector Search & RAG: Built-in
pgvectorsupport. Index documents and retrieve them semantically with@retriever. - Token Budgets: Automatically assemble prompt contexts (
@context) that fit within your LLM's context window, prioritizing high-value information. - Semantic Cache: Cache expensive LLM computations or retrieval results.
- 📖 Read the Context Store Guide
📊 For ML Engineers (The Feature Store)
- Point-in-Time Correctness: Zero data leakage. Uses
ASOF JOIN(DuckDB) andLATERAL JOIN(Postgres) to fetch feature values exactly as they existed at inference time. - Hybrid Logic: Mix Python (for complex Pandas/Numpy transformations) and SQL (for heavy database aggregations) in the same pipeline.
- Event-Driven: Trigger feature updates instantly from Redis Streams (
trigger="transaction_event").
🏗️ Architecture
Meridian scales with you from Laptop to Production.
graph TD
subgraph Dev [Tier 1: Local Development]
A[Laptop] -->|Uses| B(DuckDB)
A -->|Uses| C(In-Memory Dict)
style Dev fill:#e1f5fe,stroke:#01579b
end
subgraph Prod [Tier 2: Production]
D[API Pods] -->|Async| E[(Postgres + pgvector)]
D -->|Async| F[(Redis)]
style Prod fill:#fff3e0,stroke:#ff6f00
end
Switch{MERIDIAN_ENV} -->|development| Dev
Switch -->|production| Prod
🏭 Production Configuration
Deploy to production by simply setting environment variables. No code changes required.
# Security
MERIDIAN_API_KEY=change_me_to_something_secure
# Data Stores
MERIDIAN_REDIS_URL=redis://redis-host:6379
MERIDIAN_POSTGRES_URL=postgresql+asyncpg://user:pass@db-host:5432/meridian # pragma: allowlist secret
# LLM Providers (for RAG)
OPENAI_API_KEY=sk-...
🗺️ Roadmap
- ✅ Phase 1: Core API, DuckDB/Postgres support, Redis caching, FastAPI serving, PIT Correctness, Async I/O.
- ✅ Phase 2 (v1.2.0): Context Store, RAG infrastructure, pgvector, Event-Driven features, Time Travel.
- ✅ Phase 2.x (v1.2.4): Release Polish, CLI improvements, Timezone robustness.
- 🚧 Phase 3: Drift detection, RBAC, and multi-region support.
🤝 Contributing
We love contributions! This is a community-driven project. Please read our CONTRIBUTING.md to get started.
Meridian © 2025
Apache 2.0 License
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 meridian_oss-1.2.4.tar.gz.
File metadata
- Download URL: meridian_oss-1.2.4.tar.gz
- Upload date:
- Size: 466.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
527bccdfe3c87ed09e40a3e4454810b59851a0a9bf08577b8d6a9a3aa7ac72d3
|
|
| MD5 |
4eb18f7a15b3ac173b699821782b6aee
|
|
| BLAKE2b-256 |
b09c06518440174fdccfb691ff2f489b0ec5cf08980c275ccf81ccf48140a225
|
Provenance
The following attestation bundles were made for meridian_oss-1.2.4.tar.gz:
Publisher:
release.yml on davidahmann/meridian
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
meridian_oss-1.2.4.tar.gz -
Subject digest:
527bccdfe3c87ed09e40a3e4454810b59851a0a9bf08577b8d6a9a3aa7ac72d3 - Sigstore transparency entry: 749356595
- Sigstore integration time:
-
Permalink:
davidahmann/meridian@64ea32395ea143b4398cf5e165c8e3cde10f9e6e -
Branch / Tag:
refs/tags/v1.2.4 - Owner: https://github.com/davidahmann
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@64ea32395ea143b4398cf5e165c8e3cde10f9e6e -
Trigger Event:
push
-
Statement type:
File details
Details for the file meridian_oss-1.2.4-py3-none-any.whl.
File metadata
- Download URL: meridian_oss-1.2.4-py3-none-any.whl
- Upload date:
- Size: 60.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d52af85b8b3f25953218f6d68d57259bc8470941db70685c59168ba9a7d82733
|
|
| MD5 |
cba2231fa541549484a93e83442d7a1f
|
|
| BLAKE2b-256 |
eba451d0a93045bf03d4d8abb86ddf33668d7ef9bbcc2b2a3bc82a3d91428b76
|
Provenance
The following attestation bundles were made for meridian_oss-1.2.4-py3-none-any.whl:
Publisher:
release.yml on davidahmann/meridian
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
meridian_oss-1.2.4-py3-none-any.whl -
Subject digest:
d52af85b8b3f25953218f6d68d57259bc8470941db70685c59168ba9a7d82733 - Sigstore transparency entry: 749356604
- Sigstore integration time:
-
Permalink:
davidahmann/meridian@64ea32395ea143b4398cf5e165c8e3cde10f9e6e -
Branch / Tag:
refs/tags/v1.2.4 - Owner: https://github.com/davidahmann
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@64ea32395ea143b4398cf5e165c8e3cde10f9e6e -
Trigger Event:
push
-
Statement type: