Polyglot architecture: Python + TypeScript + Rust via A2A
Pick the right SDK for each layer of your stack
Real companies rarely use one language everywhere: Python leads in RAG/ML/fine-tuning, TypeScript powers web UIs and Next.js backends, and Rust excels at high-throughput CLI/edge gateways.
PraisonAI lets every service talk over standard HTTP or the Agent-to-Agent (A2A) protocol without forcing a rewrite.
Example
def recommend_sdk(need: str) -> str:
table = {
'rag_ml_train': 'Python (praisonai) — full RAG, eval, fine-tuning, and data ecosystem',
'web_fullstack': 'TypeScript (npm install praisonai) — Next.js, Node APIs, shared UI types',
'cli_edge_perf': 'Rust (cargo add praisonai) — single binary, minimal RAM, strict safety',
}
return table.get(need, 'Combine via AgentOS HTTP / A2A protocol')
for case in ('rag_ml_train', 'web_fullstack', 'cli_edge_perf'):
print(case, '->', recommend_sdk(case))Example explained
- Python — Best for heavy RAG, vector DBs, Judge evals, and praisonai-train.
- TypeScript / Rust — Best for web backends and ultra-fast binaries calling Python agents over HTTP/A2A.
Expose a Python specialist over HTTP for TS and Rust clients
Wrap your Python RAG or research agent with AgentOS so any TypeScript or Rust service can delegate work via a single JSON endpoint.
Example
# Serve your Python specialist agent
praisonai serve agents.yaml --port 8000
# Call it from TypeScript (fetch) or Rust (reqwest)
curl -s -X POST http://127.0.0.1:8000/agents/researcher/run \
-H 'Content-Type: application/json' \
-d '{"query": "Summarize Q4 churn risks"}'Example explained
- praisonai serve agents.yaml — Exposes Python agents as clean HTTP/A2A endpoints consumable by any language.
Common pitfall: duplicating prompt logic across languages
Keep each capability owned by one service (for example, RAG lives in Python AgentOS) and let TypeScript/Rust call it as a remote agent or tool rather than maintaining two divergent copies of the same prompt.
Reference: documentation