MossSimSearch wraps a Moss index and returns results in sim.ai’s expected shape — ready to serve from a webhook that sim.ai calls as an external HTTP tool.
Note: For a complete FastAPI server and setup guide, see the sim.ai cookbook.
How it works
sim.ai workflows call external HTTP tools. You run a small webhook server backed byMossSimSearch and point an HTTP tool node at it. When the workflow triggers the tool, Moss answers in under 10 ms and the result flows back into the workflow.
Required tools
- Moss Portal project with credentials
- Python 3.10+
- uv (optional but recommended)
- A sim.ai workspace with a deployed workflow
Integration guide
1
Installation
Install If you are using the cookbook example, you can sync the dependencies directly using
sim-moss along with FastAPI and Uvicorn:uv:2
Environment setup
Set your Moss credentials as environment variables. You can create a
.env file or export them directly:3
Serve from a webhook
Wrap the search in a FastAPI webhook server:Start the webhook server locally using The server pre-loads the Moss index on startup. Check
uvicorn (or uv run uvicorn):/health to confirm readiness.4
Add the tool to your sim.ai workflow
In your sim.ai workflow editor, add an HTTP tool node:
Map the response:
results[*].content → injected into the LLM context block.API
POST /search
Request
GET /health
Returns {"status": "ok", "index_loaded": true} once the index is warm.