Overview
Explore the AxilJS AI platform for TypeScript and Node.js applications, including LLM provider abstraction, streaming, embeddings, vector search, RAG pipelines, AI agents, and MCP tool integration.
AxilJS AI Platform Overview
The AxilJS AI platform provides a unified foundation for building AI applications with TypeScript and Node.js.
It brings together LLM provider abstraction, streaming, embeddings, vector search, retrieval-augmented generation (RAG), AI agents, and Model Context Protocol (MCP) integration under the @axiljs/ai package.
The provider abstraction lets applications work with different AI providers while keeping application-level AI code consistent.
What Is Included
AxilJS AI includes the following capabilities:
- Provider abstraction — Connect to OpenAI, Anthropic, Gemini, and Ollama through a unified interface.
- Streaming — Process AI responses token-by-token using streaming and SSE.
- Embeddings — Convert text into numerical vectors for semantic search and retrieval workflows.
- Vector store — Store and retrieve vectors for semantic search.
- RAG pipeline — Index documents and query relevant information for AI applications.
- Agents — Build ReAct-style AI agents that can reason and use tools.
- MCP client — Connect AI applications and agents to external tools through Model Context Protocol.
These capabilities can be used independently or combined to build more advanced AI workflows.
Quick Example
The @axiljs/ai package provides a common interface for interacting with supported AI providers.
For example, you can use the Ollama provider with a local model:
The same completion interface can be used across the supported provider implementations.
Switch LLM Providers
AxilJS separates application-level AI logic from the underlying LLM provider.
This means you can switch providers without rewriting the application code that consumes the AI interface.
Provider selection can be changed through environment configuration, allowing the underlying model provider to change without requiring changes to the application-level AI logic.
AI Platform Architecture
The main AxilJS AI capabilities can be viewed as layers:
Each capability addresses a different part of an AI application:
- Providers handle access to LLMs.
- Streaming handles incremental AI responses.
- Embeddings convert text into vectors.
- Vector stores support semantic retrieval.
- RAG combines retrieval with AI generation.
- Agents combine model reasoning with executable tools.
- MCP provides an interface for integrating external tools.
Build AI Applications with AxilJS
The platform can be used for different levels of AI application complexity.
For a basic AI application, start with a provider and complete():
For applications that need semantic retrieval, use embeddings and the RAG capabilities.
For applications that need autonomous multi-step tool execution, use Agents.
For applications that need external tool integration, use the MCP client.
Common Use Cases
AxilJS AI capabilities can be combined to build applications such as:
- AI chat applications
- AI assistants
- Semantic search systems
- Retrieval-augmented generation applications
- Document question-answering systems
- Tool-enabled AI agents
- Multi-step AI workflows
- Applications using local LLMs
- Applications integrating external MCP tools
Explore the AI Platform
Start with Providers to understand the LLM provider abstraction.
Then explore Embeddings and RAG for retrieval-based AI applications.