inferedge-moss


Nameinferedge-moss JSON
Version 1.0.0b3 PyPI version JSON
download
home_pageNone
SummaryPython SDK for semantic search with on-device AI capabilities
upload_time2025-10-09 23:50:58
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords search semantic embeddings vector inferedge
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # MOSS - Minimal On-Device Semantic Search

`inferedge-moss` enables **private, on-device semantic search** in your Python applications with cloud storage capabilities.

Built for developers who want **instant, memory-efficient, privacy-first AI features** with seamless cloud integration.

## ✨ Features

- ⚡ **On-Device Vector Search** - Sub-millisecond retrieval with zero network latency
- 🔍 **Semantic Search & Hybrid Search** - Beyond keyword matching
- ☁️ **Cloud Storage Integration** - Automatic index synchronization with cloud storage
- 📦 **Multi-Index Support** - Manage multiple isolated search spaces
- 🛡️ **Privacy-First by Design** - Computation happens locally, only indexes sync to cloud
- 🚀 **High-Performance Rust Core** - Built on optimized Rust bindings for maximum speed

## 📦 Installation

```bash
pip install inferedge-moss
```

## 🚀 Quick Start

```python
import asyncio
from inferedge_moss import MossClient
from moss import DocumentInfo

async def main():
    # Initialize search client with project credentials
    client = MossClient("your-project-id", "your-project-key")

    # Prepare documents to index
    documents = [
        DocumentInfo(
            id="doc1",
            text="How do I track my order? You can track your order by logging into your account.",
            metadata={"category": "shipping"}
        ),
        DocumentInfo(
            id="doc2", 
            text="What is your return policy? We offer a 30-day return policy for most items.",
            metadata={"category": "returns"}
        ),
        DocumentInfo(
            id="doc3",
            text="How can I change my shipping address? Contact our customer service team.",
            metadata={"category": "support"}
        )
    ]

    # Create an index with documents (syncs to cloud)
    index_name = "faqs"
    await client.create_index(index_name, documents, "moss-minilm")
    print("Index created and synced to cloud!")

    # Load the index (from cloud or local cache)
    await client.load_index(index_name)

    # Search the index
    result = await client.query(
        index_name,
        "How do I return a damaged product?",
        3  # top 3 results
    )

    # Display results
    print(f"Query: {result.query}")
    for doc in result.docs:
        print(f"Score: {doc.score:.4f}")
        print(f"ID: {doc.id}")
        print(f"Text: {doc.text}")
        print("---")

asyncio.run(main())
```

## 🔥 Example Use Cases

- Smart knowledge base search with cloud backup
- Realtime Voice AI agents with persistent indexes
- Personal note-taking search with sync across devices
- Private in-app AI features with cloud storage
- Local semantic search in edge devices with cloud fallback

## Available Models

- `moss-minilm`: Lightweight model optimized for speed and efficiency
- `moss-mediumlm`: Balanced model offering higher accuracy with reasonable performance

## 🔧 Getting Started

### Prerequisites

- Python 3.8 or higher
- Valid InferEdge project credentials

### Environment Setup

1. **Install the package:**

```bash
pip install inferedge-moss
```

2. **Get your credentials:**

Sign up at [InferEdge Platform](https://platform.inferedge.dev) to get your `project_id` and `project_key`.

3. **Set up environment variables (optional):**

```bash
export MOSS_PROJECT_ID="your-project-id"
export MOSS_PROJECT_KEY="your-project-key"
```

### Basic Usage

```python
import asyncio
from inferedge_moss import MossClient
from moss import DocumentInfo

async def main():
    # Initialize client
    client = MossClient("your-project-id", "your-project-key")
    
    # Create and populate an index
    documents = [
        DocumentInfo(id="1", text="Python is a programming language"),
        DocumentInfo(id="2", text="Machine learning with Python is popular"),
    ]
    
    await client.create_index("my-docs", documents, "moss-minilm")
    await client.load_index("my-docs")
    
    # Search
    results = await client.query("my-docs", "programming language")
    for doc in results.docs:
        print(f"{doc.id}: {doc.text} (score: {doc.score:.3f})")

asyncio.run(main())
```

## 📚 API Reference

### MossClient

#### `MossClient(project_id: str, project_key: str)`

Initialize the client with your InferEdge project credentials.

#### `create_index(index_name: str, docs: List[DocumentInfo], model_id: str) -> bool`

Create a new search index with documents. The index is automatically synced to cloud storage.

#### `load_index(index_name: str) -> str`

Load an index from cloud storage or local cache for querying.

#### `query(index_name: str, query: str, top_k: int = 5) -> SearchResult`

Search for similar documents using semantic similarity.

#### `add_docs(index_name: str, docs: List[DocumentInfo]) -> Dict[str, int]`

Add new documents to an existing index.

#### `list_indexes() -> List[IndexInfo]`

Get all available indexes in your project.

## 🛠️ Development

For development setup, contributing guidelines, and technical documentation, see [SETUP.md](./SETUP.md).

## 📄 License

This package is licensed under the [PolyForm Shield License 1.0.0](./LICENSE).

- ✅ Free for testing, evaluation, internal use, and modifications.
- ❌ Not permitted for production or competing commercial use.
- 📩 For commercial licenses, contact: <contact@inferedge.dev>

## 📬 Contact

For support, commercial licensing, or partnership inquiries, contact us: [contact@inferedge.dev](mailto:contact@inferedge.dev)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "inferedge-moss",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "search, semantic, embeddings, vector, inferedge",
    "author": null,
    "author_email": "\"InferEdge Inc.\" <contact@inferedge.dev>",
    "download_url": "https://files.pythonhosted.org/packages/33/07/d7ce489eb7740d198096e7180b335824e1860fb80aa0f8ef3dea9e885a87/inferedge_moss-1.0.0b3.tar.gz",
    "platform": null,
    "description": "# MOSS - Minimal On-Device Semantic Search\n\n`inferedge-moss` enables **private, on-device semantic search** in your Python applications with cloud storage capabilities.\n\nBuilt for developers who want **instant, memory-efficient, privacy-first AI features** with seamless cloud integration.\n\n## \u2728 Features\n\n- \u26a1 **On-Device Vector Search** - Sub-millisecond retrieval with zero network latency\n- \ud83d\udd0d **Semantic Search & Hybrid Search** - Beyond keyword matching\n- \u2601\ufe0f **Cloud Storage Integration** - Automatic index synchronization with cloud storage\n- \ud83d\udce6 **Multi-Index Support** - Manage multiple isolated search spaces\n- \ud83d\udee1\ufe0f **Privacy-First by Design** - Computation happens locally, only indexes sync to cloud\n- \ud83d\ude80 **High-Performance Rust Core** - Built on optimized Rust bindings for maximum speed\n\n## \ud83d\udce6 Installation\n\n```bash\npip install inferedge-moss\n```\n\n## \ud83d\ude80 Quick Start\n\n```python\nimport asyncio\nfrom inferedge_moss import MossClient\nfrom moss import DocumentInfo\n\nasync def main():\n    # Initialize search client with project credentials\n    client = MossClient(\"your-project-id\", \"your-project-key\")\n\n    # Prepare documents to index\n    documents = [\n        DocumentInfo(\n            id=\"doc1\",\n            text=\"How do I track my order? You can track your order by logging into your account.\",\n            metadata={\"category\": \"shipping\"}\n        ),\n        DocumentInfo(\n            id=\"doc2\", \n            text=\"What is your return policy? We offer a 30-day return policy for most items.\",\n            metadata={\"category\": \"returns\"}\n        ),\n        DocumentInfo(\n            id=\"doc3\",\n            text=\"How can I change my shipping address? Contact our customer service team.\",\n            metadata={\"category\": \"support\"}\n        )\n    ]\n\n    # Create an index with documents (syncs to cloud)\n    index_name = \"faqs\"\n    await client.create_index(index_name, documents, \"moss-minilm\")\n    print(\"Index created and synced to cloud!\")\n\n    # Load the index (from cloud or local cache)\n    await client.load_index(index_name)\n\n    # Search the index\n    result = await client.query(\n        index_name,\n        \"How do I return a damaged product?\",\n        3  # top 3 results\n    )\n\n    # Display results\n    print(f\"Query: {result.query}\")\n    for doc in result.docs:\n        print(f\"Score: {doc.score:.4f}\")\n        print(f\"ID: {doc.id}\")\n        print(f\"Text: {doc.text}\")\n        print(\"---\")\n\nasyncio.run(main())\n```\n\n## \ud83d\udd25 Example Use Cases\n\n- Smart knowledge base search with cloud backup\n- Realtime Voice AI agents with persistent indexes\n- Personal note-taking search with sync across devices\n- Private in-app AI features with cloud storage\n- Local semantic search in edge devices with cloud fallback\n\n## Available Models\n\n- `moss-minilm`: Lightweight model optimized for speed and efficiency\n- `moss-mediumlm`: Balanced model offering higher accuracy with reasonable performance\n\n## \ud83d\udd27 Getting Started\n\n### Prerequisites\n\n- Python 3.8 or higher\n- Valid InferEdge project credentials\n\n### Environment Setup\n\n1. **Install the package:**\n\n```bash\npip install inferedge-moss\n```\n\n2. **Get your credentials:**\n\nSign up at [InferEdge Platform](https://platform.inferedge.dev) to get your `project_id` and `project_key`.\n\n3. **Set up environment variables (optional):**\n\n```bash\nexport MOSS_PROJECT_ID=\"your-project-id\"\nexport MOSS_PROJECT_KEY=\"your-project-key\"\n```\n\n### Basic Usage\n\n```python\nimport asyncio\nfrom inferedge_moss import MossClient\nfrom moss import DocumentInfo\n\nasync def main():\n    # Initialize client\n    client = MossClient(\"your-project-id\", \"your-project-key\")\n    \n    # Create and populate an index\n    documents = [\n        DocumentInfo(id=\"1\", text=\"Python is a programming language\"),\n        DocumentInfo(id=\"2\", text=\"Machine learning with Python is popular\"),\n    ]\n    \n    await client.create_index(\"my-docs\", documents, \"moss-minilm\")\n    await client.load_index(\"my-docs\")\n    \n    # Search\n    results = await client.query(\"my-docs\", \"programming language\")\n    for doc in results.docs:\n        print(f\"{doc.id}: {doc.text} (score: {doc.score:.3f})\")\n\nasyncio.run(main())\n```\n\n## \ud83d\udcda API Reference\n\n### MossClient\n\n#### `MossClient(project_id: str, project_key: str)`\n\nInitialize the client with your InferEdge project credentials.\n\n#### `create_index(index_name: str, docs: List[DocumentInfo], model_id: str) -> bool`\n\nCreate a new search index with documents. The index is automatically synced to cloud storage.\n\n#### `load_index(index_name: str) -> str`\n\nLoad an index from cloud storage or local cache for querying.\n\n#### `query(index_name: str, query: str, top_k: int = 5) -> SearchResult`\n\nSearch for similar documents using semantic similarity.\n\n#### `add_docs(index_name: str, docs: List[DocumentInfo]) -> Dict[str, int]`\n\nAdd new documents to an existing index.\n\n#### `list_indexes() -> List[IndexInfo]`\n\nGet all available indexes in your project.\n\n## \ud83d\udee0\ufe0f Development\n\nFor development setup, contributing guidelines, and technical documentation, see [SETUP.md](./SETUP.md).\n\n## \ud83d\udcc4 License\n\nThis package is licensed under the [PolyForm Shield License 1.0.0](./LICENSE).\n\n- \u2705 Free for testing, evaluation, internal use, and modifications.\n- \u274c Not permitted for production or competing commercial use.\n- \ud83d\udce9 For commercial licenses, contact: <contact@inferedge.dev>\n\n## \ud83d\udcec Contact\n\nFor support, commercial licensing, or partnership inquiries, contact us: [contact@inferedge.dev](mailto:contact@inferedge.dev)\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Python SDK for semantic search with on-device AI capabilities",
    "version": "1.0.0b3",
    "project_urls": {
        "Documentation": "https://docs.inferedge.com/moss",
        "Homepage": "https://github.com/inferedge/moss",
        "Repository": "https://github.com/inferedge/moss"
    },
    "split_keywords": [
        "search",
        " semantic",
        " embeddings",
        " vector",
        " inferedge"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "38251e4523e6804ecc6af7eca847371269fbb2e059539e153c5a44182e493f13",
                "md5": "93867df9d12b957c7ce35cd349bed87b",
                "sha256": "a4ce3605be9b08aa0ef7d6e4367625156ae1aa9faee2cd3fb5c1a87a266f6539"
            },
            "downloads": -1,
            "filename": "inferedge_moss-1.0.0b3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "93867df9d12b957c7ce35cd349bed87b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 19482,
            "upload_time": "2025-10-09T23:50:57",
            "upload_time_iso_8601": "2025-10-09T23:50:57.687381Z",
            "url": "https://files.pythonhosted.org/packages/38/25/1e4523e6804ecc6af7eca847371269fbb2e059539e153c5a44182e493f13/inferedge_moss-1.0.0b3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3307d7ce489eb7740d198096e7180b335824e1860fb80aa0f8ef3dea9e885a87",
                "md5": "781892fc06bd8836eac52ad3a4e6ac92",
                "sha256": "81c915de65a96260ef93039a29219a9e30ac383d4baa0ddcc547e89446ca9b30"
            },
            "downloads": -1,
            "filename": "inferedge_moss-1.0.0b3.tar.gz",
            "has_sig": false,
            "md5_digest": "781892fc06bd8836eac52ad3a4e6ac92",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 20739,
            "upload_time": "2025-10-09T23:50:58",
            "upload_time_iso_8601": "2025-10-09T23:50:58.503722Z",
            "url": "https://files.pythonhosted.org/packages/33/07/d7ce489eb7740d198096e7180b335824e1860fb80aa0f8ef3dea9e885a87/inferedge_moss-1.0.0b3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-09 23:50:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "inferedge",
    "github_project": "moss",
    "github_not_found": true,
    "lcname": "inferedge-moss"
}
        
Elapsed time: 1.64778s