Skip to main content

Self-hosted vector database + NoSQL with built-in AI semantic search โ€” the async Python client for Montycat. A Rust-powered, AI-native Pinecone / Weaviate / Chroma alternative for RAG, AI agents & LLM memory.

Project description

๐Ÿ Montycat for Python โ€” The AI-Native NoSQL Database with Semantic Search for RAG & Agents

Abolish the two-database stack.

The official async Python client for Montycat โ€” a self-hosted NoSQL + vector database with AI semantic search forged into the core, built for RAG and AI-agent memory. One Rust engine, not a sprawl of services. Your hardware. Your data. Your meaning.

PyPI Version PyPI Downloads Docker Pulls Python Version License: MIT

# Search your data by MEANING โ€” no external APIs, no separate vector database.
# (already ON by default in the montycat-semantic server edition)
hits = await Sales.semantic_search_get_values("Show all Bluetooth devices", limit=5)
# โ†’ [{__key__: 123..., __score__: 0.82, __value__: {"name": "Wireless Headphones"}}]

๐Ÿงฉ All-in-one. AI-native. Zero external dependencies.

The vector-embedding engine runs inside the database โ€” no separate vector DB, no embedding API, no API keys, no sidecar service. One engine, one binary, your hardware.

What is Montycat?

For a generation we were told the price of intelligence was two systems: a database for your records, and a separate vector store โ€” with its per-query bill โ€” for their meaning. Montycat rejects that tax. It is a self-hosted NoSQL + vector database: one Rust-powered engine with semantic search built in, so RAG, AI-agent memory, and vector search live where your data already lives. No cloud lock-in. No ops headache. Decentralized by nature, ultra-fast, and natively async.

Think of it as an open-source, self-hosted alternative to Pinecone, Weaviate, Chroma, Qdrant, and Redis โ€” a vector database and a NoSQL store in a single engine, so your records and their embeddings live together instead of in two systems you have to keep in sync. Montycat is not an incremental improvement on the databases you know. It is a break with them.

๐Ÿง  Why Montycat?

  • โšก Blazing Speed โ€” Powered by the Montycat Engine written in Rust, built for microsecond-level read/write performance.
  • ๐ŸŒ€ Async-First Design โ€” Fully asynchronous, built on asyncio. Perfect for APIs, pipelines, and real-time apps.
  • ๐Ÿ’พ Hybrid Storage โ€” In-memory for raw speed or persistent for durability โ€” or mix both in one engine.
  • ๐Ÿ”Ž AI Semantic & Vector Search โ€” Rank data by meaning with on-device embeddings. Built-in kNN vector search for RAG, AI agents & LLM apps โ€” no external API, no separate vector database. (requires the montycat-semantic server edition โ€” Docker image, package, or apt; see below.)
  • ๐Ÿงฉ Schema-Aware โ€” Define data schemas in Python, enforce them at runtime โ€” with zero ceremony.
  • ๐Ÿ—‚๏ธ True Data Mesh Architecture โ€” Each keyspace is a self-owned, domain-oriented data product.
  • ๐Ÿ“ก Reactive Subscriptions โ€” Subscribe to live updates in real-time โ€” per key or per keyspace.
  • ๐Ÿ›ก๏ธ Memory-Safe & Secure โ€” Backed by Rustโ€™s zero-cost abstractions and modern TLS communication.
  • ๐Ÿค Developer-Centric API โ€” Intuitive, predictable, and ready for production.
  • ๐Ÿ“š Beautifully Documented โ€” Every method, every example, crystal clear.

๐Ÿ’ก Philosophy

Montycat is not a database wrapper. Itโ€™s a new way to think about data โ€” composable, fast by design. No legacy baggage. Just clean async functions and pure data. Montycat isnโ€™t inspired by NoSQL. It redefines it โ€” with elegance, concurrency, and memory safety.

Montycat for Python?

This is the official Python client, built to bring Montycatโ€™s next-generation Data Mesh architecture directly into your Python applications โ€” manage and query your data with the flexibility of NoSQL and true decentralized data ownership. Forget ORM hell, clunky SQL syntax, and blocking I/O. With Montycat, data feels alive โ€” reactive, structured, and fast enough to keep up with your imagination.

๐Ÿ” Example Use Cases

  • RAG pipelines & semantic retrieval for LLM-powered apps
  • AI agent / chatbot long-term memory that survives restarts
  • Semantic product search & recommendations โ€” match intent, not keywords
  • Real-time dashboards and analytics
  • Async ETL pipelines with real-time awareness and processing
  • Microservice data stores and event-driven systems
  • Collaborative data products in a Mesh architecture

๐Ÿš€ Get the Engine (30 seconds)

The client talks to a Montycat server. Fastest way โ€” Docker, with AI semantic search built in:

docker run -d --name montycat \
  -p 21210:21210 -p 21211:21211 \
  -e MONTYCAT_SUPEROWNER="admin" \
  -e MONTYCAT_PASSWORD="change-me" \
  -v montycat_data:/var/lib/.montycat \
  montygovernance/montycat:semantic

Prefer the lean edition without the embedding engine? Use the latest tag. Prebuilt packages (apt, macOS, Windows) at https://montygovernance.com.

Installation

Install the Python client with pip:

pip install montycat

Quick Start

import asyncio
from montycat import Engine, Keyspace, Schema

# setup connection

connection = Engine(
    host="127.0.0.1",
    port=21210,
    username="USER",
    password="12345",
    store="Departments",
)

# keyspaces: persistent or in-memory โ€” mix freely in one engine

class Sales(Keyspace.Persistent):
    keyspace = "Sales"

class Production(Keyspace.InMemory):
    keyspace = "Production"

Sales.connect_engine(connection)
Production.connect_engine(connection)

# schemas, enforced on the database side (optional)

class SalesSchema(Schema):
    product: str
    amount: int

class ProductionSchema(Schema):
    items: list
    work_order: str | None

async def main():
    # create store and keyspaces using runtime migration
    await Sales.create_keyspace()
    await Production.create_keyspace()

    await Sales.enforce_schema(SalesSchema)
    await Production.enforce_schema(ProductionSchema)

    # write
    sale = SalesSchema(product="Product1", amount=12).serialize()
    await Sales.insert_value(sale)

    order = ProductionSchema(items=["Product1"], work_order="WO 000012").serialize()
    await Production.insert_value(order)

    # query
    print(await Sales.lookup_values_where(schema=SalesSchema, key_included=True))
    print(await Production.lookup_keys_where(work_order="WO 000012"))

asyncio.run(main())

๐Ÿง  AI-Native Semantic Search โ€” Vector Search Built Into Your Database

Stop bolting a separate vector database onto your stack. Montycat ranks your data by meaning, not keywords โ€” an embedded, on-device vector-embedding engine turns every write into a searchable vector automatically. It's the retrieval layer for RAG pipelines, AI agents, semantic search, recommendation engines, and LLM-powered apps โ€” with zero external APIs, zero API keys, and zero extra infrastructure.

  • ๐Ÿ”Ž Semantic / vector search โ€” kNN similarity over on-device embeddings, not brittle keyword matches.
  • ๐Ÿค– Built for AI โ€” RAG, semantic retrieval, AI agents, recommendations, dedup, clustering.
  • ๐Ÿ”’ Private & free โ€” embeddings never leave your machine. No OpenAI/Cohere bill, no data egress.
  • โšก One system, not two โ€” your data and its vectors live in the same database. No sync jobs, no drift, no second service to run.
  • ๐Ÿš€ Zero setup โ€” no index tuning, no pipeline: enable_semantic_search() and you're ranking by meaning.

โš ๏ธ Requires the semantic edition of the server โ€” nothing to compile. Semantic search runs an embedded ONNX vector-embedding engine that ships only in the montycat-semantic edition; the default lean montycat server does not include it. Get it the way that suits you โ€” pull the Docker image (montygovernance/montycat:semantic), download the prebuilt package, or install montycat-semantic from the apt repository. The Python client API is identical either way; just point it at a semantic-edition server (semantic search is enabled by default there, using the bge-small model).

The switch is DB-wide and already on in the semantic edition. The embedding model is downloaded on demand, and every keyspace is embedded in the background as data is written.

# Semantic search is ON by default in the montycat-semantic edition โ€” just search.
# Rank stored items by meaning โ€” two flavors:
#   get_values โ†’ each hit is {__key__, __score__, __value__}
#   get_keys   โ†’ each hit is {__key__, __score__} (lighter; fetch a page later with get_bulk)
hits = await Sales.semantic_search_get_values("Show all Bluetooth devices", limit=5)
keys = await Sales.semantic_search_get_keys("Show all Bluetooth devices", limit=5)

# Optionally drop weak matches by cosine similarity (range [-1, 1]).
strong = await Sales.semantic_search_get_keys("Show all Bluetooth devices", limit=5, min_score=0.35)

# Control the DB-wide switch (optional โ€” it's already on):
# switch the embedding model: 'minilm' | 'bge-small' (default) | 'bge-base' | 'e5-small'
await connection.enable_semantic_search(model="bge-base")

# turn it off (vectors are kept so re-enabling resumes instantly;
# pass drop_vectors=True to also clear stored vectors)
await connection.disable_semantic_search()

Hybrid semantic search

Restrict meaning-based ranking to records matching structured metadata. The filter is a hard AND pre-filter with the same criteria shape as lookup_keys_where; it does not boost cosine scores.

matching_keys = await Sales.semantic_search_get_keys_where(
    "astronomy and outer space",
    {"category": "space"},
    limit=5,
    min_score=0.35,
)

matching_values = await Sales.semantic_search_get_values_where(
    "astronomy and outer space",
    {"category": "space"},
    limit=5,
)
# key hits:   {"__key__", "__score__"}
# value hits: {"__key__", "__score__", "__value__"}

๐Ÿ”— Links

โ“ FAQ

  • Is Montycat a vector database or a NoSQL database? Both โ€” one engine. Store records and query them by meaning (vector / semantic search) or by key/schema, without running two systems.
  • Do I need OpenAI or an embedding API? No. Embeddings run on-device in the montycat-semantic server. No API keys, no per-query bill, no data egress.
  • Is it a Pinecone / Weaviate / Chroma / Qdrant alternative? Yes โ€” self-hosted and open-source, with a NoSQL store built in.
  • Which Python versions? 3.9+ โ€” fully async (asyncio).

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

montycat-1.0.7.tar.gz (31.4 kB view details)

Uploaded Source

File details

Details for the file montycat-1.0.7.tar.gz.

File metadata

  • Download URL: montycat-1.0.7.tar.gz
  • Upload date:
  • Size: 31.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for montycat-1.0.7.tar.gz
Algorithm Hash digest
SHA256 26c1a9e23767701eaa49f1ae1e8bb195b0969b09730ec2df82450bc4712b7024
MD5 81f53b7f4a92614af84d9296fad6aeba
BLAKE2b-256 9fb7bdbf6fdba9da1f8ed2b97950c6f557da3e3a19584b17a1684e45e8e6a2da

See more details on using hashes here.

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