Skip to main content

Moss semantic search integration for Agno agents

Project description

agno-moss

The Moss in-memory semantic search runtime for Agno agents.

Moss manages embeddings internally and serves queries from an in-memory runtime — sub-10ms lookups, no external embedder, no vector database to run. Point Knowledge at MossRuntime and Agno agents get instant RAG with zero infrastructure.

Installation

pip install agno-moss
# or
uv add agno-moss

Prerequisites

  • Moss project ID and project key — get them from the Moss Portal
  • Python 3.10+
  • An Agno-compatible model provider (OpenAI, Anthropic, etc.)

Quickstart

import os
from agno.agent import Agent
from agno.knowledge.knowledge import Knowledge
from agno.models.anthropic import Claude
from agno_moss import MossRuntime

knowledge = Knowledge(
    vector_db=MossRuntime(
        index_name="my-index",
        # Falls back to MOSS_PROJECT_ID / MOSS_PROJECT_KEY env vars
    ),
)

agent = Agent(
    model=Claude(id="claude-sonnet-4-20250514"),
    knowledge=knowledge,
    search_knowledge=True,
    markdown=True,
)

knowledge.load(recreate=False)
agent.print_response("What do you know about our return policy?", stream=True)

Configuration

MossRuntime

Parameter Default Description
index_name (required) Name of the Moss index
project_id MOSS_PROJECT_ID env var Moss project ID
project_key MOSS_PROJECT_KEY env var Moss project key
embedding_model "moss-minilm" "moss-minilm" (fast) or "moss-mediumlm" (higher accuracy)
alpha 0.8 Hybrid search blend: 1.0 = semantic only, 0.0 = keyword only
auto_refresh False Auto-refresh the in-memory index when new docs are added
polling_interval_in_seconds 600 Refresh interval when auto_refresh=True

How it works

MossRuntime implements Agno's VectorDb base class:

  • create() — loads an existing index into Moss's in-memory runtime. Call once at startup for fast first queries.
  • upsert() — creates the index on first call, then adds or updates documents. Loads the index automatically after each batch.
  • search() — hybrid semantic + keyword search via the loaded in-memory runtime. Falls back to the cloud API if the index is not loaded.

Moss filters metadata only when the index is loaded locally. content_hash_exists() returns False when unloaded (safe: forces re-upsert rather than silently skipping).

Choosing a model provider

# OpenAI
from agno.models.openai import OpenAIChat
agent = Agent(model=OpenAIChat(id="gpt-4o"), knowledge=knowledge, search_knowledge=True)

# Anthropic
from agno.models.anthropic import Claude
agent = Agent(model=Claude(id="claude-sonnet-4-20250514"), knowledge=knowledge, search_knowledge=True)

See the Agno model providers docs for the full list.

License

BSD 2-Clause — see LICENSE.

Support

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agno_moss-0.0.1.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agno_moss-0.0.1-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file agno_moss-0.0.1.tar.gz.

File metadata

  • Download URL: agno_moss-0.0.1.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for agno_moss-0.0.1.tar.gz
Algorithm Hash digest
SHA256 a75909d60ed822a2dc224b047a7cca764ce6b71e42c32c09bd1af3ebe654ad79
MD5 69020ca32c8821759765614070e21824
BLAKE2b-256 622ac8d4a0ba53c624a66c25f65bafeb8ed4d164beb496f85ad1047071e04db4

See more details on using hashes here.

File details

Details for the file agno_moss-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: agno_moss-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for agno_moss-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 91bb801e60304a9a09ac05b0c307b9f26ebe7bc31ae4b6912e8c159478b10895
MD5 87f5ab706cf89aea919265a2f5129517
BLAKE2b-256 3b29aa9aeecc5bfadceb892ab0f1fd49b60172f94e7a562506e101abc275b76d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page