Skip to main content

Moss Tool

This tool provides integration with Moss, a real-time semantic search engine.

Installation

pip install llama-index-tools-moss

Usage

You can use the MossToolSpec to interact with your Moss index.

Initialization

import os
from llama_index.tools.moss import MossToolSpec, QueryOptions
from inferedge_moss import MossClient

# Initialize the client
# The client requires a Moss project key and a project ID
MOSS_PROJECT_KEY = os.getenv("MOSS_PROJECT_KEY")
MOSS_PROJECT_ID = os.getenv("MOSS_PROJECT_ID")
client = MossClient(project_id=MOSS_PROJECT_ID, project_key=MOSS_PROJECT_KEY)

# Initialize the tool
# Note: You can customize top_k and alpha through query_options (hybrid search weight)
options = QueryOptions(alpha=0.6, top_k=9, model_id="moss-minilm")
tool = MossToolSpec(
    client=client, index_name="my_index", query_options=options
)

# Convert to tool list for agents
tools = tool.to_tool_list()

Indexing Documents

You can index documents into your Moss index using the index_docs method:

from inferedge_moss import DocumentInfo

docs = [
    DocumentInfo(
        text="LlamaIndex is great!", metadata={"source": "review.txt"}
    ),
    DocumentInfo(text="Moss is fast!", metadata={"source": "specs.txt"}),
]

# Index the documents
await tool.index_docs(docs)

Parameters

  • client (MossClient): The initialized Moss client.
  • index_name (str): The name of the index to query.
  • query_options (QueryOptions): Configuration options for the tool (optional).
    • top_k (int, default=5): Number of results to return.
    • alpha (float, default=0.5): Weight for hybrid search (0.0=keyword, 1.0=semantic).
    • model_id (str, default="moss-minilm"): The model ID to use for embeddings.

MODEL IDs

  • moss-minilm: Fast, lightweight (default). Best for speed-first, edge/offline use.
  • moss-mediumlm: Higher accuracy with reasonable performance. Best when search quality is important.

Examples

The examples/ directory contains:

Metadata

Release files for llama-index-tools-moss 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llama-index-tools-moss 0.3.0
File Size Uploaded Provenance
llama_index_tools_moss-0.3.0.tar.gz 5.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for llama-index-tools-moss 0.3.0
File Interpreter ABI Platform
llama_index_tools_moss-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.5 kB

Release files / llama_index_tools_moss-0.3.0.tar.gz

Download URL llama_index_tools_moss-0.3.0.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0cb23086aa28a006a906adce9adb753463541b13155ae6f0d6478079aa5f1789
BLAKE2b-256 checksum
How to use checksums
b568b568ca91c0af088739ede3c108882faae89a9e4d2dcf68e963546e29a870
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / llama_index_tools_moss-0.3.0-py3-none-any.whl

Download URL llama_index_tools_moss-0.3.0-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0255fa4388553e7e13b8a29cfc769afe64b069a62c6d3d1f84d41d5fc613aa81
BLAKE2b-256 checksum
How to use checksums
4b23d00ea2c95026b6bd96273547b6c82d522385c40c6b85a63921868b9c5913
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for llama-index-tools-moss 0.3.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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page