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.4.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.4.0
File Size Uploaded Provenance Actions
llama_index_tools_moss-0.4.0.tar.gz 5.3 kB Without provenance Details for llama_index_tools_moss-0.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 10.5 kB

Release files / llama_index_tools_moss-0.4.0.tar.gz

Download URL llama_index_tools_moss-0.4.0.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ca326c43d9be8d5be2bde66d6b87ec3fa12def4a7134fe1316defc65e697b5bc
BLAKE2b-256 checksum
How to use checksums
4c576bd7fd53b27df247f284502bb04865671e1f8a6e9615342eee342d11ead6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","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.4.0-py3-none-any.whl

Download URL llama_index_tools_moss-0.4.0-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
449bd10a8f5c59cc3103d5260f0a11cbfef0bc96cb403da47c4212b3920ca26d
BLAKE2b-256 checksum
How to use checksums
cd2776e3eb7c5ce1fe34082daeb3ec1de51c92a77c52f974d54e80adfd005294
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","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.4.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