mirror of
https://github.com/hanzoai/agents.git
synced 2026-10-30 18:48:36 +00:00
Transforms hanzoai/agents from a marketplace config repo into a full agent orchestration platform by merging the AgentField infrastructure: - Go control plane (K8s-like agent orchestration, service mesh, DAG workflows) - Python SDK (FastAPI-based agent framework, LiteLLM, memory, DID/VC) - TypeScript SDK (@hanzo/agents - Vercel AI SDK, MCP, workflows) - Go SDK (idiomatic agent builder + client) - React 19 embedded dashboard (XyFlow DAGs, Recharts, Radix UI) - Docker/K8s/Helm deployment configs - Examples: hello world, deep research, RAG, simulation, benchmarks - Functional test suite across Python/Go/TypeScript All references rebranded: AgentField → Hanzo Agents - Module: github.com/hanzoai/agents/control-plane - Python: hanzo_agents - TypeScript: @hanzo/agents - Go: github.com/hanzoai/agents/sdk/go - Env vars: HANZO_AGENTS_* - Config: hanzo-agents.yaml Previous marketplace configs moved to config/ directory.
48 lines
1.3 KiB
Python
48 lines
1.3 KiB
Python
"""
|
|
RAG Evaluation Agent Node
|
|
|
|
Multi-reasoner evaluation system for RAG-generated responses featuring:
|
|
- Faithfulness: Adversarial debate pattern (Prosecutor vs Defender)
|
|
- Relevance: Multi-jury consensus voting
|
|
- Hallucination: Hybrid ML+LLM chain-of-verification
|
|
- Constitutional: Configurable principles-based evaluation
|
|
|
|
Production-ready backend AI for enterprise RAG evaluation.
|
|
"""
|
|
|
|
import os
|
|
|
|
# Load .env file for local development
|
|
try:
|
|
from dotenv import load_dotenv
|
|
load_dotenv()
|
|
except ImportError:
|
|
pass # python-dotenv not installed, use environment variables directly
|
|
|
|
from hanzo_agents import Agent, AIConfig
|
|
from reasoners import router
|
|
|
|
|
|
# Initialize agent
|
|
app = Agent(
|
|
node_id="rag-evaluation",
|
|
version="1.0.0",
|
|
description="Multi-reasoner RAG evaluation with adversarial debate, jury consensus, and hybrid ML+LLM verification",
|
|
hanzo_agents_server=os.getenv("HANZO_AGENTS_SERVER", "http://localhost:8080"),
|
|
ai_config=AIConfig(
|
|
model=os.getenv("AI_MODEL", "openrouter/deepseek/deepseek-chat-v3-0324"),
|
|
),
|
|
)
|
|
|
|
# Include the evaluation router with all metric reasoners
|
|
app.include_router(router)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
# Start the agent server
|
|
port_env = os.getenv("PORT")
|
|
if port_env is None:
|
|
app.run(auto_port=True, host="0.0.0.0")
|
|
else:
|
|
app.run(port=int(port_env), host="0.0.0.0")
|