Skip to main content

langchain-pqs

LangChain integration for PQS (Protocol Quality Standard) — the Certificate Authority for AI agent economy.

Gives LangChain agents the ability to verify whether an API endpoint is PQS-certified before calling it, and to discover trusted providers from the PQS registry.

Installation

pip install langchain-pqs

Configuration

Set the PQS CA server URL (defaults to http://localhost:4025):

export PQS_CA_URL=http://localhost:4025

Or pass it directly:

from langchain_pqs import PQSVerifyTool

tool = PQSVerifyTool(pqs_ca_url="https://pqs.smartflowproai.com")

Tools

PQSVerifyTool

Check if an API endpoint is PQS-verified:

from langchain_pqs import PQSVerifyTool

verify = PQSVerifyTool()
result = verify.invoke({"endpoint": "https://api.example.com/v1/signals"})
print(result)

Output:

Endpoint: https://api.example.com/v1/signals
Verified: YES
PQS Score: 87
PQS Tier: gold
EAS UID: 0xabc123...
Capabilities: market-signals, risk-scoring
Registered: 2026-04-01T00:00:00Z
Verified at: 2026-04-02T12:00:00Z
Expires: 2027-04-02T12:00:00Z
Owner: ExampleCorp

PQSListProvidersTool

List all verified providers (with optional keyword filter):

from langchain_pqs import PQSListProvidersTool

providers = PQSListProvidersTool()
result = providers.invoke({"filter": "signals"})
print(result)

Usage with LangChain Agent

from langchain_openai import ChatOpenAI
from langchain.agents import AgentExecutor, create_tool_calling_agent
from langchain_core.prompts import ChatPromptTemplate
from langchain_pqs import PQSVerifyTool, PQSListProvidersTool

llm = ChatOpenAI(model="gpt-4o")
tools = [PQSVerifyTool(), PQSListProvidersTool()]

prompt = ChatPromptTemplate.from_messages([
    ("system", "You are an AI agent that only calls PQS-verified endpoints. "
               "Always verify an endpoint before using it."),
    ("human", "{input}"),
    ("placeholder", "{agent_scratchpad}"),
])

agent = create_tool_calling_agent(llm, tools, prompt)
executor = AgentExecutor(agent=agent, tools=tools)

result = executor.invoke({
    "input": "Is https://api.example.com/v1/signals a trusted endpoint?"
})

License

MIT

Metadata

Release files for langchain-pqs 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-pqs 0.1.0
File Size Uploaded
langchain_pqs-0.1.0.tar.gz 3.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-pqs 0.1.0
File Interpreter ABI Platform
langchain_pqs-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.3 kB

Release files / langchain_pqs-0.1.0.tar.gz

Download URL langchain_pqs-0.1.0.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
02c2da1b34c17c2f432b215dc4e16e52c62347a80499c4606f9a568406b6d0c2
BLAKE2b-256 checksum
How to use checksums
60eb4fa551a729573f32a608af001af7795cb3408d9f9d7f21b548fcf2e15bcd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / langchain_pqs-0.1.0-py3-none-any.whl

Download URL langchain_pqs-0.1.0-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
99d19d050c69ccf5747e33ac0a5b80238334de8a75dd7cd7397e97749cfcc094
BLAKE2b-256 checksum
How to use checksums
be671a7a7036b4c34df886d128cbe21adfbec236f154798334b7e127c8da6dea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page