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:
// 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:
// 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:
// 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:
- Installation - Add the SDK to your project
- Quick Start - Build your first agent in 5 minutes
- Authentication - Secure your API connection
- 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:
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 β
- GitHub: aisar-ai/aisar-sdk
- Discord: Join our community
- Docs: You're reading them!
- Examples: Check out the examples section
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.
