sim-moss
Moss semantic search integration for sim.ai workflows.
Provides MossSimSearch — a lightweight adapter that queries a preloaded Moss index and returns documents in sim.ai's expected {"content", "score", "source"} shape, ready to be served from a webhook that sim.ai calls as an external tool.
Installation
pip install sim-moss
Prerequisites
- Moss project ID and project key (get them from Moss Portal)
- Python 3.10+
- A sim.ai workspace with a deployed workflow
Quick Start
from sim_moss import MossSimSearch
search = MossSimSearch(
project_id="your-id",
project_key="your-key",
index_name="my-docs",
)
await search.load_index()
result = await search.search("How do I reset my password?")
print(result.results) # [{"content": "...", "score": 0.94, "source": "faq.md"}, ...]
print(result.time_taken_ms) # 4
Wiring into a sim.ai Workflow
sim.ai workflows can call external HTTP tools. Point an HTTP tool node at a webhook server that wraps MossSimSearch:
POST /search
Body: {"query": "{{user_message}}"}
The response shape — {"results": [...], "time_taken_ms": 4} — maps directly to sim.ai's tool output. See examples/cookbook/sim for a complete FastAPI server and setup guide.
Configuration
MossSimSearch
| Parameter | Default | Description |
|---|---|---|
project_id |
MOSS_PROJECT_ID env var |
Moss project ID |
project_key |
MOSS_PROJECT_KEY env var |
Moss project key |
index_name |
(required) | Name of the Moss index to query |
top_k |
5 |
Number of results to retrieve per query |
alpha |
0.8 |
Blend: 1.0 = semantic only, 0.0 = keyword only |
Methods
| Method | Description |
|---|---|
load_index() |
Async. Pre-load the Moss index — call once at server startup |
search(query) |
Async. Query Moss and return a SimSearchResult |
SimSearchResult
| Field | Type | Description |
|---|---|---|
results |
list[dict] |
Documents with content, score, and optional source |
time_taken_ms |
int | None |
Moss query latency |
License
This integration is provided under the BSD 2-Clause License.
Support
Metadata
Release files for sim-moss 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| sim_moss-0.0.1.tar.gz | 5.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sim_moss-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.9 kB
Release files / sim_moss-0.0.1.tar.gz
| Download URL | sim_moss-0.0.1.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3af28c5fbe8e319b854e2e0ef6ac4b7a64339dbb89c7f0f58977d0a81569d17a
|
|
BLAKE2b-256 checksum How to use checksums |
d4722940002200363893045459ef5e8bce5a610297ab6d1b425f0fdfde8b3ded
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / sim_moss-0.0.1-py3-none-any.whl
| Download URL | sim_moss-0.0.1-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3e2161c06b5d10ea793ec17a0e2ca31dad709e8c76e824f04b2310d0c1884540
|
|
BLAKE2b-256 checksum How to use checksums |
7bb9ddf18ef5b246ce1a9d3e5a29a963382f947cf9a59566ef1f05682958fa4b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Security for sim-moss 0.0.1
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.