π¦ ClawHub
ChromaDB Agent Router
by @mars375
Local semantic message routing for multi-agent systems. Routes messages to the correct agent based on embeddings + keyword + context scoring. No external API...
β‘ When to Use
π‘ Examples
1. Define Your Routes
Create a routes configuration file (JSON or Python dict):
ROUTES = {
"ops": {
"agent": "orion",
"descriptions": [
"Deploy and manage infrastructure and Docker containers",
"Install, configure, and restart services",
"DevOps operations, CI/CD, deployment pipelines",
],
"keywords": ["deploy", "install", "docker", "compose", "container", "restart"],
"action_verbs": ["dΓ©ploie", "installe", "configure", "redΓ©marre"],
},
"security": {
"agent": "aegis",
"descriptions": [
"Security audits, vulnerability scanning, hardening",
"Firewall rules, SSL certificates, access control",
],
"keywords": ["security", "firewall", "ssl", "vulnerability"],
"action_verbs": ["sΓ©curise", "hardened"],
},
# ... add more routes
}
2. Initialize and Route
from semantic_router import SemanticRouterrouter = SemanticRouter(routes_config="routes.json")
router.initialize() # Builds ChromaDB index (~6s cold start, then cached)
result = router.route("Deploy the new monitoring stack on the homelab")
β {"route": "ops", "agent": "orion", "confidence": 0.94}
3. Use in OpenClaw
# Start the API server
python3 scripts/router-api.py --port 8321Route a message
curl -X POST http://localhost:8321/route \
-H "Content-Type: application/json" \
-d '{"message": "Check the firewall logs for suspicious activity"}'
TERMINAL
clawhub install chromadb-agent-router