Skip to content

Introduction ​

Welcome to the Aisar SDK! This powerful TypeScript library enables you to build sophisticated AI agents with advanced memory capabilities, tool integration, and seamless chat experiences.

What is Aisar SDK? ​

The Aisar SDK is a comprehensive toolkit for creating intelligent AI agents that can:

  • Remember conversations using vector-based semantic memory
  • Execute tools and integrate with external APIs
  • Manage sessions with persistent context and streaming
  • Scale efficiently with production-ready architecture

Key Features ​

🧠 Advanced Memory System ​

Unlike traditional chatbots that forget context, Aisar agents maintain intelligent memory using vector embeddings:

typescript
// Create memory-enabled agent
const agent = await aisar.createAgent({
  name: 'Assistant',
  memoryEnabled: true,
  instructions: 'Remember user preferences and conversation history'
});

// Search through conversation history
const memories = await aisar.searchMemory(agent.id, {
  query: 'user preferences about coffee',
  limit: 5
});

πŸ› οΈ Tool Integration ​

Agents can execute custom functions and integrate with external services:

typescript
// Define a custom tool
const weatherTool = await aisar.createTool({
  name: 'get_weather',
  description: 'Get current weather for a location',
  schema: {
    type: 'object',
    properties: {
      location: { type: 'string', description: 'City name' }
    },
    required: ['location']
  }
});

// Agent can now use the weather tool in conversations

πŸ’¬ Session Management ​

Manage conversations with persistent context and real-time streaming:

typescript
// Create a session
const session = await aisar.createSession(agent.id, 'user123');

// Add messages with streaming
const response = await session.addMessage('user', 'What\'s the weather like?');

// Get conversation history
const messages = await session.getMessages();

Architecture Overview ​

The Aisar SDK follows a clean, modular architecture:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     Agent       β”‚    β”‚     Memory      β”‚    β”‚    Session      β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚    β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚    β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚Instructionsβ”‚  β”‚    β”‚  β”‚Vector Storeβ”‚  β”‚    β”‚  β”‚Messages   β”‚  β”‚
β”‚  β”‚Model Config β”‚  β”‚    β”‚  β”‚Embeddings β”‚  β”‚    β”‚  β”‚Context    β”‚  β”‚
β”‚  β”‚Tools       β”‚  β”‚    β”‚  β”‚Search     β”‚  β”‚    β”‚  β”‚Streaming  β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚    β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚    β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚                       β”‚                       β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β–Ό
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚    Platform API         β”‚
                    β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚
                    β”‚  β”‚PostgreSQL+pgvectorβ”‚  β”‚
                    β”‚  β”‚Cloudflare Workersβ”‚   β”‚
                    β”‚  β”‚OpenAI/Anthropic β”‚    β”‚
                    β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Getting Started ​

Ready to build your first AI agent? Here's what's next:

  1. Installation - Add the SDK to your project
  2. Quick Start - Build your first agent in 5 minutes
  3. Authentication - Secure your API connection
  4. Core Concepts - Learn about agents, memory, and sessions

Use Cases ​

The Aisar SDK is perfect for:

  • Customer Support Bots with conversation memory
  • Personal Assistants that learn user preferences
  • Document Q&A Systems with semantic search
  • Workflow Automation with tool integration
  • Multi-turn Conversations with context preservation

TypeScript Support ​

The SDK is built with TypeScript from the ground up:

typescript
import type { Agent, CreateAgentInput, Memory } from '@aisar/sdk';

// Full type safety and auto-completion
const agentConfig: CreateAgentInput = {
  name: 'My Agent',
  instructions: 'Be helpful',
  model: 'gpt-4', // TypeScript knows valid models
  memoryEnabled: true
};

Community & Support ​

What's Next? ​

Choose your learning path:

New to AI development? Start with our Quick Start Guide to build your first agent step-by-step.

Experienced developer? Jump to the API Reference for detailed documentation of all classes and methods.

Looking for inspiration? Browse our Examples to see real-world implementations and best practices.

Released under the MIT License.