Skip to main content

Magnetic Outlier Agent: Patent-pending outlier detection for RAG systems and telehealth compliance

Project description

Magnetic Outlier Agent (MOA)

Patent Pending • U.S. Provisional Serial No. 63/926,578 filed November 27, 2025
License • Business Source License 1.1 (Change Date: November 27, 2029)
Trademarks Pending • "Magnetic Outlier Agent" and "MOA"


Overview

MOA is a geometric multi-metric outlier detection system for embedding vectors in Retrieval-Augmented Generation (RAG) pipelines. It uses a patented triple-metric approach combining centroid distance, local density, and graph curvature to identify low-quality or non-compliant documents before they reach your LLM.

Use cases:

  • RAG quality filtering (remove hallucination-prone chunks)
  • Telehealth compliance auditing (detect missing consent/risks language)
  • Regulatory integration via MCP (ICD-10, CPT billing, state bills)

Quick Start

pip install moa-telehealth

Basic Usage

from moa.filters import MOAOutlierFilter

# Initialize filter
moa = MOAOutlierFilter(threshold=1.5)

# Score documents
embeddings = [[0.1, 0.2, ...], ...]  # Your doc embeddings
scores, outliers = moa.score(embeddings)

# Filter out outliers
clean_docs = [doc for i, doc in enumerate(docs) if i not in outliers]

LangChain Integration

from langchain_community.embeddings import HuggingFaceEmbeddings
from moa.integrations.langchain import MOAOutlierFilter

# Initialize filter
embeddings = HuggingFaceEmbeddings(model_name="all-MiniLM-L6-v2")
filter = MOAOutlierFilter(embedding_model=embeddings, threshold=1.5)

# Filter documents in RAG pipeline
filtered_docs = filter.transform_documents(retrieved_docs)

FastAPI Server (MCP)

Start the Model Context Protocol server:

python moa_mcp_server.py

API endpoints:

  • GET /health - Health check
  • POST /audit - Outlier detection (accepts text chunks)
  • POST /api/generate - Gemini proxy

IP & Security Status


Documentation


Features

Core Algorithm (Patent Pending)

  • Triple-metric scorer: Combines centroid distance (d), local density (δ), and graph curvature (κ)
  • Bridge-path detection: Identifies weak links in k-NN graphs
  • Spectral degradation: Fourier analysis for time-ordered corpora

Integrations

  • LangChain - Drop-in RAG filter
  • MCP - Claude Desktop tools for regulatory lookups
  • FastAPI - RESTful endpoints for web/n8n
  • Streamlit - Interactive compliance editor

Regulatory Layer (MCP)

  • ICD-10 lookup (NLM Clinical Tables) - Free, 1000/day
  • CPT billing (eCFR §410.78) - Free, unlimited
  • State bills (OpenStates) - Free, 5000/day (API key required)
  • PHI guard - Automatic blocking of SSN/phone/names

Known Limitations (v1.0.x)

  • Multilingual Support: Optimized for English/Latin scripts. Non-Latin scripts (Cyrillic, CJK) are safely handled via a fallback bucket but have reduced sensitivity. Full multilingual support is scheduled for v1.1.

License

Business Source License 1.1
© 2025 Michael Ordon. Patent Pending U.S. Provisional 63/926,578. All Rights Reserved.

  • Permitted: Evaluation, research, internal use (≤100 visits/month)
  • Restricted: Commercial SaaS offerings before change date (2029-11-27)
  • Change License: Apache 2.0 (after Nov 27, 2029)

For commercial licensing: licensing@moa-telehealth.com


Citation

If you use MOA in research, please cite:

@misc{ordon2025moa,
  title={Magnetic Outlier Agent: Geometric Multi-Metric Outlier Detection for RAG Systems},
  author={Ordon, Michael},
  year={2025},
  note={U.S. Provisional Patent Application Serial No. 63/926,578}
}

Contact

Inventor: Michael Ordon (Culver City, CA)
Email: contact@moa-telehealth.com
Patent: U.S. Provisional 63/926,578
License: BUSL 1.1
Links: PyPI | Patent Center

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

moa_telehealth-1.0.2.tar.gz (71.9 kB view details)

Uploaded Source

Built Distribution

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

moa_telehealth-1.0.2-py3-none-any.whl (51.0 kB view details)

Uploaded Python 3

File details

Details for the file moa_telehealth-1.0.2.tar.gz.

File metadata

  • Download URL: moa_telehealth-1.0.2.tar.gz
  • Upload date:
  • Size: 71.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for moa_telehealth-1.0.2.tar.gz
Algorithm Hash digest
SHA256 cae3963f88ddec49749eef7e4ebd1692a5ca4cd58c4bfd2b501b1057ba6f8016
MD5 38ba6a16489ed0c64a350d68112feaa4
BLAKE2b-256 34e42806825b1b10a8a9911139b8a3823648ab2bb6a1d22fa3d82504dfc71f6c

See more details on using hashes here.

File details

Details for the file moa_telehealth-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: moa_telehealth-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 51.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for moa_telehealth-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 68cedacad999c19411daa599b97dce4c9b35ddf8483d476fffabe348a6b31aa1
MD5 25d3381a63771ad0d4c5df022724fdfd
BLAKE2b-256 a91d0a7890a9d47e76ccad22440e38a7fb32b86cd06684e5fe587c9650574c58

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