moss_search automatically when it needs to look something up — no retrieval glue code required.
Note: For a complete example, see the Strands Agents cookbook.
Why use Moss with Strands Agents?
Strands Agents exposes tools as first-class primitives.MossSearchTool wraps a Moss index as a Strands-compatible tool, so the agent decides when to retrieve — and gets answers back in under 10 ms.
Required tools
- Moss account with project credentials
- Python 3.10+
- Model provider credentials — Strands Agents defaults to Amazon Bedrock. Configure
AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY, andAWS_REGION, or pass a different model provider (see below).
Integration guide
Choosing a model provider
Strands defaults to Amazon Bedrock. To use a different provider, pass amodel argument:
Multi-agent example
Moss tools compose with Strands’ agents-as-tools pattern:Configuration
MossSearchTool
| 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 |
tool_name | moss_search | Tool name exposed to the LLM |
tool_description | (auto-generated) | Tool description exposed to the LLM |
top_k | 5 | Number of results to retrieve per query |
alpha | 0.8 | Blend: 1.0 = semantic only, 0.0 = keyword only |
result_prefix | Relevant knowledge base results:\n\n | Prefix prepended to formatted results |
Methods
| Method | Description |
|---|---|
load_index() | Async. Pre-load the Moss index — call once at startup |
search(query) | Async. Query Moss and return formatted results as a string |
tool | Property. Returns the Strands-compatible tool to pass to Agent(tools=[...]) |