hai-ai

Manage LLM calls, MCP servers, tools, streaming, and memory in Node.js and browsers.

3|7|Updated Jan 28, 2026
One-click install
npx skills add https://github.com/hai-series/hai-framework --skill hai-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hai-ai
Source: https://github.com/hai-series/hai-framework/tree/main/packages/cli/templates/skills/hai-ai
Command: npx skills add https://github.com/hai-series/hai-framework --skill hai-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

hai-ai consolidates LLM calling, MCP server creation, tool registration, streaming, memory management, and context handling to deliver end-to-end AI-powered workflows with consistent APIs and safer error handling.

Core Features & Use Cases

  • Unified LLM interactions (chat and chatStream) with optional tool integration and registry-driven tool calls.
  • MCP server support for streaming HTTP/SSE/Stdio, resource registration, and prompt management.
  • Memory management with object isolation and session persistence across conversations, enabling context-aware experiences.
  • Context compression and integration with vector stores for scalable, long-running sessions.
  • Suitable for AI assistants, enterprise chatbots, and knowledge-intensive apps needing reliable AI orchestration.

Quick Start

Configure hai-ai in your app and start an AI-enabled workflow that uses LLMs, tools and memory to manage conversations.

Frequently Asked Questions about hai-ai

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage memory and compress context for long-running LLM conversations?

You can manage memory and compress context for long-running LLM conversations by using memory extraction, object isolation, and session persistence, integrating with vector stores to maintain scalable and context-aware AI workflows.

How do I set up an MCP server for streaming HTTP and SSE responses?

To set up an MCP server for streaming HTTP, SSE, or Stdio responses, use the unified API surface that manages resource registration and prompt management while applying the init, use, and close lifecycle.

Can I define and register custom tools for LLM invocation in both Node.js and browser environments?

Yes, you can define and register custom tools for LLM invocation across Node.js and browser environments using a registry-driven approach that standardizes tool calls and ensures safer error handling via HaiResult.

What is the best way to orchestrate end-to-end AI workflows with unified LLM calling and tool integration?

The best way to orchestrate end-to-end AI workflows with unified LLM calling is to use a cohesive API that combines chat and chatStream interactions with optional tool integration, memory management, and context compression.

Does this AI tooling require Zod schemas for configuration validation?

Yes, configuration validation is handled through Zod schemas to ensure standardized setup, while the lifecycle of init, use, and close manages safe error handling and consistent API interactions across sessions.

Why should I use a unified API for AI assistants instead of separate libraries for LLM calling and memory management?

Using a unified API for AI assistants consolidates LLM calling, tool registration, and memory management into one cohesive surface, eliminating fragmented libraries and ensuring consistent context handling and safer error handling.