Skip to content
This repository was archived by the owner on Jun 21, 2026. It is now read-only.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

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

About

LangChain integration for PQS (Protocol Quality Standard) — endpoint verification for AI agents

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages