Skip to main content

An integration package connecting Verifly (agent-native email verification) and LangChain

Project description

langchain-verifly

LangChain integration for Veriflyagent-native email verification.

langchain-verifly gives any LangChain agent a single, well-described tool to check whether an email address is real and deliverable before it sends a message or accepts a signup. It wraps the Verifly verification API and returns a clean, structured verdict (deliverable / undeliverable / risky), the reason, a confidence score, and an actionable send-or-reject recommendation.

Installation

pip install -U langchain-verifly

Setup

Set your Verifly API key in the environment. You can self-onboard for a key (with free credits) at verifly.email.

export VERIFLY_API_KEY="vf_..."

Tool: VeriflyEmailVerifier

A LangChain BaseTool with both sync and async support.

from langchain_verifly import VeriflyEmailVerifier

verifier = VeriflyEmailVerifier()  # reads VERIFLY_API_KEY from the environment

verifier.invoke({"email": "lead@example.com"})
{
    "email": "lead@example.com",
    "result": "deliverable",
    "reason": "Mailbox exists",
    "confidence": 95,
    "is_valid": True,
    "recommendation": "send",
    "did_you_mean": None,
    "details": {
        "syntax_valid": True,
        "domain_exists": True,
        "mx_records": True,
        "smtp_valid": True,
        "is_disposable": False,
        "is_role_account": False,
        "is_catch_all": False,
        "is_free_provider": False,
        "provider": "example.com",
    },
}

Async works too:

await verifier.ainvoke({"email": "lead@example.com"})

You can also pass the key explicitly instead of using the environment variable:

verifier = VeriflyEmailVerifier(api_key="vf_...")

Use it in an agent

from langchain.agents import create_react_agent  # or any agent constructor
from langchain_verifly import VeriflyEmailVerifier

tools = [VeriflyEmailVerifier()]
# ... wire `tools` into your agent / model.bind_tools(tools) as usual

The agent can now verify an address on its own — for example, scrubbing a lead list, validating a user-supplied email at signup, or confirming a contact before drafting an outreach email.

Verdict fields

Field Meaning
result deliverable, undeliverable, or risky
reason Human-readable explanation of the verdict
confidence Confidence score, 0–100
is_valid Whether the address is considered valid/usable
recommendation send, do_not_send, or risky
did_you_mean A suggested correction for likely typos, if any
details Syntax / domain / MX / SMTP / disposable / role / catch-all / free-provider flags

License

MIT

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

langchain_verifly-0.1.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

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

langchain_verifly-0.1.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file langchain_verifly-0.1.0.tar.gz.

File metadata

  • Download URL: langchain_verifly-0.1.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for langchain_verifly-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bc82a0e5c58745d3f2941fd113fa59bbdf124def6df8c2c5e767be6346d6cee4
MD5 0385b97f72afca5fec8b63da8d771b8b
BLAKE2b-256 4620fa0c61dd5b2830620998f5d47c1b46639ba897f36f41b9a38ea454050297

See more details on using hashes here.

File details

Details for the file langchain_verifly-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_verifly-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dee0ff04234e5edb78f9abd33d8af67234b1f5e687d38d16e7479719b49a041d
MD5 e3bb5c45a53c2e9a029212815c5299df
BLAKE2b-256 9ad40f018c0fa7842390fe02129780668d554659bcb1dbd9849e49da6996c52b

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