Exercises

Apply TypeScript, Rust, and polyglot PraisonAI patterns across 6 realistic scenarios.

1. In a Next.js app, why must new Agent(…) run inside an app/api/…/route.ts server handler instead of a client React component?

2. What happens if a Next.js route reuses one global stateful Agent instance across concurrent users without session isolation?

3. How does the PraisonAI Rust SDK generate the JSON parameter schema for a custom Rust tool?

4. Why should you avoid calling blocking std::fs I/O directly inside an async Rust #[tool] function?

5. Your company has a Next.js web app and a heavy Python RAG + fine-tuning pipeline. What is the cleanest PraisonAI architecture?

6. In a Node.js script using an MCP stdio server, what prevents the process from hanging after the agent prints its final answer?

Back to the TypeScript and Rust tutorial