Skip to content

Aganium/langchain-agenium

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

langchain-agenium

LangChain integration for the Agenium agent:// protocol — discover and communicate with AI agents via agent-to-agent DNS.

Installation

pip install langchain-agenium

Quick Start

Single Agent Tool

from langchain_agenium import AgeniumTool

tool = AgeniumTool(agent_uri="agent://search.agenium")
result = tool.invoke("Find me AI papers about transformers")

Toolkit (Auto-Discovery)

from langchain_agenium import AgeniumToolkit

toolkit = AgeniumToolkit(dns_server="185.204.169.26")
tools = toolkit.get_tools()  # One LangChain tool per registered agent

With a LangChain Agent

from langchain_openai import ChatOpenAI
from langchain.agents import initialize_agent
from langchain_agenium import AgeniumToolkit

llm = ChatOpenAI(model="gpt-4")
toolkit = AgeniumToolkit()
tools = toolkit.get_tools()

agent = initialize_agent(tools, llm, agent="zero-shot-react-description")
response = agent.run("Use the search agent to find papers about transformers")

Retriever (Search for Agents)

from langchain_agenium import AgeniumRetriever

retriever = AgeniumRetriever()
docs = retriever.invoke("search")  # Find agents matching query

Components

Core

Class Base Description
AgeniumTool BaseTool Send messages to a specific agent:// agent
AgeniumToolkit BaseToolkit Auto-discover agents and create tools
AgeniumRetriever BaseRetriever Search agents as LangChain Documents
AgentResolver Low-level DNS resolution for agent:// URIs

Ecosystem Integrations (NEW)

from langchain_agenium import AgeniumLLM, AgeniumEmbeddings, AgeniumVectorStore
Class Base Description
AgeniumLLM LLM Use any agent:// as an LLM provider
AgeniumEmbeddings Embeddings Get embeddings from agent:// endpoints
AgeniumVectorStore VectorStore Use agent:// as vector store backend
AgeniumMemory BaseMemory Persistent conversation history via agent://
AgeniumCallbackHandler BaseCallbackHandler Stream LangChain events to agents
AgeniumLoader BaseLoader Load documents from agent:// endpoints
AgeniumOutputParser BaseOutputParser Parse agent:// response formats

Pre-built Chains

from langchain_agenium import AgentResearchChain, AgentOrchestratorChain, AgentRAGChain
Chain Description
AgentResearchChain Fan-out queries to multiple agents, aggregate results
AgentOrchestratorChain Route tasks to agents by capability
AgentRAGChain Retrieval + generation split across agents

Configuration

All components accept:

  • dns_server — Agenium DNS server IP (default: 185.204.169.26)
  • dns_port — DNS server port (default: 3000)
  • timeout — Request timeout in seconds (default: 30)

Protocol

Agenium uses agent:// URIs for agent identity and DNS-based discovery. Agents register with the DNS system and communicate via the Agenium protocol (JSON over HTTPS).

  • DNS resolution: GET /agent/lookup/{name}
  • Agent listing: GET /agents
  • Message format: Agenium Protocol Frame (version 1.0)

Domain Registration

Supports optional domain registration on the Agenium DNS system using a marketplace API key (dom_<64 hex>). Pass api_key parameter to auto-register your agent on startup. Get your API key from the Telegram Domain Marketplace.

License

MIT

About

LangChain integration for the [Agenium](https://agenium.net) `agent://` protocol — discover and co

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages