Skip to main content

Metacog Python SDK — Governed vertical AI for regulated industries

Project description

Metacog Python SDK

The world's first governed vertical AI SDK for regulated industries in India.

PyPI version Governance Score Hallucination Rate

What makes Metacog different

Every other AI API gives you an answer. Metacog gives you a governed answer.

Every response includes:

  • Confidence score — how certain is the AI? (M1)
  • Source citations — which act and section? (V3)
  • PII protection — no PAN, Aadhaar, or salary data leaked (M7)
  • Hallucination risk — low / medium / high (M6)
  • Drift status — are answers consistent over time? (M3)

Measured results:

  • 0% hallucination rate across 37 Indian compliance questions
  • 60% governance score vs 7% industry average
  • +53 percentage points advantage over nearest competitor

Installation

pip install metacog

Quick start

import metacog

client = metacog.Metacog(api_key="mk-...")

response = client.governed.create(
    model=metacog.METACOG_M3,
    prompt="What is the TDS rate for salary of 12 lakhs under new regime?",
)

print(response.answer)
# TDS for ₹12 lakh salary under new tax regime for FY 2024-25...

print(response.confidence)
# 0.94

print(response.sources)
# ['Income Tax Act Section 192', 'Finance Act 2024']

print(response.governance_passed)
# True

print(response.hallucination_risk)
# 'low'

Governance parameters

response = client.governed.create(
    model=metacog.METACOG_M3,
    prompt="What is the PF contribution rate?",
    governance=metacog.GovernanceConfig(
        vertical="payroll",
        confidence_threshold=0.85,   # Block if confidence < 85%
        pii_scan=True,               # Scan for PAN, Aadhaar, salary
        cite_sources=True,           # Require act/section citations
        drift_check=True,            # Check for answer drift
    )
)

# Check if response is fully safe
if response.is_safe:
    print(response.answer)
else:
    print(f"Escalation required: confidence={response.confidence}")

Async usage

import asyncio
import metacog

async def check_compliance():
    client = metacog.Metacog(api_key="mk-...")
    response = await client.governed.acreate(
        model=metacog.METACOG_M3,
        prompt="GSTR-3B due date for May 2026?",
        governance=metacog.GovernanceConfig(vertical="gst")
    )
    return response

response = asyncio.run(check_compliance())
print(response.answer)

Available models

Model Use case Speed Governance
metacog-m1 High-volume queries, simple lookups Fast Standard
metacog-m3 Daily compliance work (recommended) Balanced Enhanced
metacog-m7 Complex reasoning, filing decisions Thorough Maximum
metacog-f1 Finance & payroll specialist Fast Standard
metacog-b1 Banking & RBI compliance Balanced Enhanced
metacog-h1 Healthcare compliance Balanced Enhanced

Verticals supported

  • payroll — TDS, PF, ESI, Form 16, Professional Tax
  • gst — GSTR-1/3B/9, ITC, E-invoice, RCM
  • labour_law — Factories Act, Maternity, Minimum Wages, Gratuity, Bonus
  • banking — RBI, KYC/AML, Basel III, NPA, CRR/SLR
  • healthcare — ABDM, Clinical Act, Drug Act, DPDP
  • insurance — IRDAI, Claims, Motor, Life, Health

Environment variables

export METACOG_API_KEY="mk-..."
export METACOG_BASE_URL="https://api.metacog.ai"  # optional

Get an API key

Visit metacog.ai or email api@metacog.ai

Free tier: 1,000 API calls/month. No credit card required.

Licensing

For embedding Metacog in your product (ERP, HRMS, fintech), contact licensing@metacog.ai

Revenue share program available for CA firms and software partners.

Links


Metacog — Governed Intelligence. Made in India. Built for the world.

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

metacog-1.0.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

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

metacog-1.0.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file metacog-1.0.0.tar.gz.

File metadata

  • Download URL: metacog-1.0.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for metacog-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6303c99d7173b367cc7c8a82233e91760004cfb0e6c0bf65aa54e2ceaa9a0319
MD5 a7e23917daaa3525c3cc353e868acab6
BLAKE2b-256 05891986255dca760a71f15c5619a6a78bff1b6af1133e97dfd6523dff11d869

See more details on using hashes here.

File details

Details for the file metacog-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: metacog-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for metacog-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8886623c4ed2ee1141532ce3ba906f8b753831a2dec4b6cb5cef624d41d560fe
MD5 341eb737a3df919eba402b8e4dd517ff
BLAKE2b-256 8cdd2ac943e62d8e140f9d4ad843b765872ca9b89cd77fb98d4fd407573c7439

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