Templates for building AI applications with the Inworld Runtime SDK. From simple LLM calls to complete voice agents, these templates demonstrate best practices and advanced patterns for conversational AI, RAG, voice processing, safety, and more.
- npm or Yarn
- Node.js v20 or higher: Download here
- Inworld API key (required): Sign up here or see quickstart guide
git clone https://github.com/inworld-ai/inworld-runtime-templates-node.git
cd inworld-runtime-nodejs-templatesnpm install
# or
yarn installCreate a .env file in the root directory:
INWORLD_API_KEY=your_api_key_hereGet your API key from the Inworld Portal.
Alternatively, export the key as an environment variable:
export INWORLD_API_KEY="your_api_key_here"| Variable | Default | Description |
|---|---|---|
INWORLD_ADDON_POOL_SIZE |
64 |
Thread pool size for native addon. Increase for high-concurrency workloads. |
# For running multiple concurrent graphs or load testing
export INWORLD_ADDON_POOL_SIZE=128Run any template using the scripts defined in package.json:
# Basic LLM chat
npm run node-llm-chat "Tell me about AI"
# Speech to text
npm run node-stt path/to/audio.wav
# Intent matching
npm run node-intent "What house are you in?"inworld-runtime-nodejs-templates/
├── src/ # All template source files
│ ├── llm/ # LLM operations, routing, and tools
│ │ ├── routing/ # Intelligent routing and conditional logic
│ │ └── tools/ # Function calling and MCP integration
│ ├── voice/ # Voice processing (STT, TTS)
│ ├── advanced/ # Advanced examples and patterns
│ ├── retrieval/ # RAG, search, intent matching, and memory
│ ├── safety/ # Content moderation and filtering
│ ├── streaming/ # Real-time streaming for text and audio
│ ├── text_processing/ # Text transformation and template rendering
│ ├── observability/ # Telemetry, metrics, and monitoring
│ ├── primitives/ # Low-level SDK primitives for direct usage
│ ├── utilities/ # Utility nodes and helpers
│ └── shared/ # Shared utilities and helpers
├── package.json # Dependencies and scripts
├── README.md # Documentation
└── LICENSE # MIT License
- Basic Chat & Completion: Simple LLM interactions
- Routing: Intelligent routing and conditional logic
- Tools: Function calling and MCP (Model Context Protocol) integration
- Component Registry: Advanced component management patterns
- Speech-to-Text (STT): Convert audio to text
- Text-to-Speech (TTS): Generate audio from text with streaming support
- RAG: Knowledge retrieval and question answering
- Intent Matching: Classify user intents and route accordingly
- Long-term Memory: Persistent conversation memory
- Content Moderation: Keyword matching and text classification
- Safety Pipelines: Complete content filtering workflows
- LLM Streaming: Real-time text generation with abort controls
- Audio Streaming: Process audio streams in real-time
Low-level SDK components for direct usage:
- Embedder: Generate text embeddings
- NER: Named entity recognition
- VAD: Voice activity detection
- Jinja Templates: Template rendering
- Start with
src/llm/llm_chat.ts- Basic LLM chat - Try
src/voice/speech_to_text.ts- Voice processing - Explore
src/streaming/- Real-time patterns
src/llm/llm_chat.ts- Basic LLM chatsrc/llm/tools/mcp_call_tool.ts- Add function callingsrc/llm/routing/llm_output_routing.ts- Add routing logicsrc/safety/safety_pipeline.ts- Add content moderation
src/voice/speech_to_text.ts- STTsrc/voice/text_to_speech.ts- TTS
src/retrieval/knowledge_retrieval.ts- Basic RAGsrc/retrieval/intent_matching.ts- Intent matchingsrc/retrieval/knowledge_routing.ts- Route based on context
Missing API Key
export INWORLD_API_KEY="your_key_here"
# Or create a .env fileModule Not Found
npm install
# or
yarn installAudio Issues
Grant microphone permissions in your browser for voice examples.
Bug Reports: GitHub Issues
General Questions: For general inquiries and support, please email us at [email protected]
We welcome contributions! Found a bug or want to add a template? Open an issue or PR, and we will review it.
For detailed guidelines, please see CONTRIBUTING.md.
This project is licensed under the MIT License - see the LICENSE file for details.