Skip to main content
Use @moss-tools/mastra to expose Moss as native Mastra tools. The package wraps MossClient in createTool() primitives that can search or update a Moss index from a Mastra agent.

Why use Moss with Mastra?

Mastra agents can call tools while reasoning. Moss gives those tools sub-10ms knowledge retrieval after an index is loaded locally, without running an external embedder or vector database.

Required tools

  • Moss project credentials from the Moss Portal
  • Node.js 18+
  • A Mastra project

Integration guide

1

Install

2

Configure credentials

3

Add Moss search to a Mastra agent

Load the Moss index once at startup, then pass mossSearchTool() into the agent’s tools.

Available tools

mossSearchTool

Searches a Moss index and returns ranked documents.

mossAddDocsTool

Adds or upserts documents into a Moss index. Use it for agents that need to remember new facts during a conversation.

Agent with search and memory