MCPcopy Index your code
hub / github.com/AlexAltea/milli-py

github.com/AlexAltea/milli-py @v1.11.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.11.1 ↗ · + Follow
43 symbols 99 edges 6 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

milli-py

ci-badge

Python bindings for Milli, the embeddable Rust-based search engine powering Meilisearch.

Due to limitations around Rust lifecycles, methods available via IndexDocuments and Search have been integrated directly into the Index class. This sacrifices/simplifies functionality available in the original milli package.

Install the package via:

pip install milli

Usage

Basic usage of the milli-py:

import milli

index = milli.Index("path/to/index")
index.add_documents([   
    { "id": 0, "title": "Hello world", "content": "This is a sample" },
    { "id": 1, "title": "Hello moon", "content": "This is another sample" },
    { "id": 2, "title": "Hello sun", "content": "This is yet another sample" },
])
results = index.search("wrold")
document = index.get_document(results[0])
assert(document['title'] == "Hello world")

Documentation

Full documentation for milli-py is available at docs/index.md.

View it online at https://github.com/AlexAltea/milli-py/blob/master/docs/index.md.

Examples

Real-world examples of milli-py in action:

  • Curator: Searching 140k movies (~10 MB csv, ~140 MB index) in around 36ms to obtain metadata from OMDB and auto-rename/tag movie collections.

Do you have other interesting examples? Let me know!

Core symbols most depended-on inside this repo

add_documents
called by 14
src/lib.rs
get_documents
called by 3
src/lib.rs
primary_key
called by 3
src/lib.rs
search
called by 3
src/lib.rs
get_document
called by 2
src/lib.rs
to_json
called by 1
src/conv.rs
all_documents
called by 1
src/lib.rs
clear_documents
called by 1
src/lib.rs

Shape

Method 31
Function 6
Class 4
Enum 2

Languages

Rust72%
Python28%

Modules by API surface

src/lib.rs16 symbols
src/conv.rs15 symbols
tests/test_milli_index.py8 symbols
benchmarks/bench.py4 symbols

For agents

$ claude mcp add milli-py \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact