Documentation
Developer documentation and API reference for building with Yohanun
Getting Started
Core Features
API Reference
Resources
Welcome to Yohanun
Yohanun is a semantic runtime that gives your applications persistent memory, automated reasoning, and contextual intelligence. While others build chatbots, you'll build genuinely intelligent applications.
The Yohanun Difference
Rules + Memory = Experience. Yohanun doesn't just store dataβit understands context, remembers relationships, and spots patterns that make your applications feel like they "just get it."
Quick Start
Get your first intelligent application running in under 5 minutes:
1. Get Your API Key
- Register for a developer account
- Generate an API key in your dashboard
- Note your API key for use in requests:
2. Make Your First AI Chat Request
What the API automatically provides:
-
π€
Intelligent Response: AI-powered conversational responses
-
π―
Intent Detection: Automatically categorizes user intent
-
π§
Memory Storage: Stores conversation context for future use
-
βοΈ
Model Selection: Uses best available AI model for the task
Authentication
All API requests require authentication using your API key in the request header:
Secure by Design
API keys use SHA-256 hashing and include automatic rate limiting, cost controls, and usage tracking.
Multi-App Support
Create separate API keys for different applications with isolated contexts and independent usage tracking.
Intelligent Processing
Yohanun's intelligent processing capabilities go beyond simple AI responses to provide context-aware, memory-enhanced, and temporally intelligent interactions.
Processing Features
Intent Detection
Every message is automatically analyzed to determine user intent, enabling appropriate responses and triggering relevant automations.
Common Intents
Information Requests
Questions, queries, help requests
Task Execution
Commands, actions, operations
Support Issues
Problems, complaints, escalations
Example Response
Entity Extraction
Automatically identifies and extracts relevant entities from user messages including dates, names, locations, products, and custom business entities.
Entity Type | Examples | Use Cases |
---|---|---|
PERSON | John Smith, Alice Cooper | User identification, personalization |
DATE_TIME | tomorrow, next week, 3pm | Scheduling, reminders |
PRODUCT | Pro Plan, API Credits | Sales, support routing |
LOCATION | New York, Europe, Building A | Routing, localization |
Context Awareness
Yohanun maintains rich context throughout conversations, understanding references, follow-up questions, and conversational flow.
Context Types
-
π¬
Conversational Context: Previous messages, topics discussed, references
-
π€
User Context: Preferences, history, profile information
-
π’
Application Context: Business rules, workflows, current state
-
β°
Temporal Context: Time-based relevance, session boundaries
Temporal Intelligence
Advanced time-aware processing that understands "this morning", "earlier today", "last week" and automatically boosts relevant memories based on temporal proximity.
Example: Thread Reactivation
When resuming a conversation after 2 days, Yohanun automatically detects the gap, retrieves relevant context from that timeframe, and provides seamless continuity.
Temporal Features
Memory Decay
Older memories naturally fade while recent interactions remain highly relevant
Session Boundaries
Automatic detection of conversation starts/stops for better context management
Time References
Natural language time processing: "this morning", "last Tuesday", "an hour ago"
Relevance Boosting
Recently discussed topics receive higher relevance scores in memory search
Real-Time WebSocket API
The Yohanun WebSocket API provides real-time streaming AI chat with live processing visibility, bidirectional communication, and enterprise-grade scaling. Experience word-by-word AI responses and instant feedback.
WebSocket Features
WebSocket Endpoints
/ws/chat
Main WebSocket chat endpoint
Full AI integration with streaming responses and live processing updates
/ws/chat/test
Interactive test page
Browser-based WebSocket testing and debugging interface
/ws/chat/stats
Connection statistics
Real-time connection monitoring and health metrics
Quick Start
1. Connect and Authenticate
2. Send Chat Messages
3. Handle Real-Time Responses
Message Types Reference
Client β Server Messages
Authentication
Chat Message
Control Messages
Server β Client Messages
Authentication Response
Live Processing Updates
Streaming AI Response
Rate Limiting & Performance
WebSocket Limits
- Sustained Rate: 60 messages/minute
- Burst Rate: 10 messages/10 seconds
- Max Connections: 1000 per container
- Heartbeat: 30-second intervals
Performance Features
- Auto-scaling: Container-aware load balancing
- Failover: Redis-coordinated redundancy
- Monitoring: Real-time connection statistics
- Health Checks: Automatic connection monitoring
Code Examples
Python WebSocket Client
Node.js WebSocket Client
Testing & Monitoring
Interactive Testing
Use the built-in test page for interactive WebSocket testing:
http://localhost:8000/ws/chat/test
Connection Statistics
Monitor WebSocket connections and performance:
Error Handling Best Practices
- Authentication Timeout: Authenticate within 10 seconds of connection
- Rate Limiting: Handle rate limit responses gracefully with exponential backoff
- Connection Loss: Implement reconnection logic with jitter to prevent thundering herd
- Message Validation: Always validate message structure before sending
AI Runtime API
The core AI Runtime API provides intelligent conversation capabilities with advanced features including intent detection, temporal memory integration, rule management, and multi-model support.
AI Runtime Features
/api/ai/chat
Primary AI chat endpoint
Intelligent Chat Processing
The main AI endpoint that processes messages with full context, memory integration, and intelligent response generation.
Request Format
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
message | string | β Yes | The user's message to process |
context | object | No | Additional context for processing |
model | string | No | AI model to use (overrides app default) |
system_prompt | string | No | Custom system instructions |
thread_id | string | No | Conversation thread identifier |
session_id | string | No | Session within thread |
user_id | string | No | User identifier for isolation |
memory_context | array | No | Memory search contexts |
Response Format
Response Fields
Field | Type | Description |
---|---|---|
response | string | Generated AI response |
intent | string | Detected user intent |
entities | object | Extracted entities from message |
model_used | string | Actual AI model used |
rule_detection | object | Rule creation opportunities |
temporal_context | object | Thread reactivation and memory info |
/api/ai/chat-stream
Streaming AI chat endpoint
Server-Sent Events (SSE) Streaming
Identical to the regular chat endpoint but returns streaming responses using Server-Sent Events. Perfect for real-time applications without WebSocket complexity.
Request Format
Streaming Response
/api/ai/detect-intent
Intent detection only
Intent Detection
Extract intent and entities from user messages without generating a response. Useful for routing and classification tasks.
Response
/api/ai/generate-response
Response generation
Response Generation
Generate natural language responses based on detected intent and entities. Useful for building custom conversation flows.
Response
Thread Management API
Manage conversation threads for persistent, contextual interactions. Threads maintain conversation history and enable temporal memory features.
/api/threads/
Create new thread
Create Thread
Response
/api/threads/{thread_id}/messages
Get thread history
Retrieve Thread Messages
Response
/api/threads/
List user threads
List Threads
Response
Persistent Memory System
Yohanun's memory system stores and retrieves contextual information across sessions, building understanding that makes your applications genuinely intelligent.
/api/memory/store
Store contextual memory
Store Contextual Memory
Store information that builds understanding over time. Memories are automatically embedded and indexed for semantic search.
Response
/api/memory/search
Search memories
Search Memory
Semantic search across stored memories with context filtering and relevance scoring.
Response
/api/memory/stats
Memory statistics
Memory Statistics
Response
Rules Engine API
Create and manage intelligent automation rules that trigger actions based on conversation patterns, user behavior, and contextual conditions.
/api/ai/create-rule
Create automation rule
Create Rule
Create intelligent automation rules using natural language. The AI analyzes your instruction and creates appropriate triggers and actions.
Response
/api/rules/
List all rules
List Rules
Response
Database Service API
Managed database instances optimized for AI workloads with automated backups, monitoring, and scaling. Deploy PostgreSQL instances with vector search capabilities.
Database Features
/api/database-service/instances
Create database instance
Create Database Instance
Deploy a managed PostgreSQL instance with AI optimizations and automated configuration.
Request Format
Response
/api/database-service/instances
List database instances
List Database Instances
Response
/api/database-service/instances/{instance_id}/metrics
Get performance metrics
Database Metrics
Real-time performance metrics including CPU, memory, storage, and AI-specific query performance.
Response
/api/database-service/templates
Get database templates
Database Templates
Pre-configured database templates optimized for different use cases.
AI Optimized
Vector search, similarity matching, AI workloads
- β’ pgvector extension
- β’ pg_trgm for text search
- β’ Optimized for embeddings
Analytics
Reporting, aggregations, time-series data
- β’ pg_stat_statements
- β’ pg_partman for partitioning
- β’ Enhanced query performance
Basic
General purpose applications
- β’ uuid-ossp extension
- β’ Standard PostgreSQL
- β’ Cost-effective option
Backup Management
Create Manual Backup
List Backups
Automated Backups
All database instances include automated daily backups with 30-day retention. Point-in-time recovery available for the last 7 days.
Storage Management API
Monitor and manage storage usage across all databases (PostgreSQL, Neo4j, Qdrant, Redis) with automated tracking, cleanup recommendations, and usage analytics.
/api/storage/usage
Get storage usage
Storage Usage
Get current storage usage across all databases with breakdown by system.
Response
/api/storage/history
Get storage history
Storage History
Response
/api/storage/cleanup
Get cleanup recommendations
Storage Cleanup
Get automated recommendations for storage optimization and cleanup.
Response
Execute Cleanup
Response
Error Handling
Understand standard error responses and implement robust error handling in your applications.
Standard Error Format
All API errors follow a consistent format with HTTP status codes and detailed error information.
Common Error Codes
HTTP Status | Error Code | Description |
---|---|---|
400 | INVALID_REQUEST | Missing required parameters or invalid format |
401 | AUTHENTICATION_FAILED | Invalid or missing API key |
403 | INSUFFICIENT_PERMISSIONS | API key lacks required permissions |
429 | RATE_LIMIT_EXCEEDED | Too many requests - rate limit exceeded |
500 | INTERNAL_SERVER_ERROR | Unexpected server error |
Error Handling Best Practices
- Implement Retry Logic: Use exponential backoff for rate limits and temporary failures
- Log Request IDs: Include request_id in error logs for debugging
- Handle Gracefully: Show user-friendly messages while logging technical details
- Monitor Error Rates: Track error patterns to identify systemic issues
Integration Guide
Get started integrating Yohanun into your applications using direct API calls or our code examples.
REST API Integration
The Yohanun platform uses standard REST APIs that work with any HTTP client in any programming language.
Python Example
JavaScript Example
WebSocket Integration
For real-time applications, use our WebSocket API for streaming responses.
SDK Development
We're currently developing official SDKs for Python, JavaScript, and other popular languages. In the meantime, the REST and WebSocket APIs provide full functionality for any HTTP client.
Interested in contributing? Contact us about SDK development opportunities.
More Examples
Find comprehensive code examples throughout this documentation:
- β’ AI Runtime API - Chat and streaming examples
- β’ WebSocket API - Real-time integration examples
- β’ Memory System - Context and memory management
- β’ Rules Engine - Automation and rule creation
- β’ Troubleshooting - Debug examples and solutions
Document Processing API
Upload, process, and search documents with intelligent chunking, relationship mapping, and semantic understanding.
/api/documents/upload
Upload document
Upload Document
Upload documents for intelligent processing with semantic chunking and relationship mapping.
Response
/api/documents/search
Search documents
Search Documents
Response
/api/documents/
List documents
List Documents
Response
Support & Resources
Troubleshooting
Common issues and solutions to help you debug and resolve problems quickly.
Common Issues
Authentication Failed
Error: "Valid API key required for this endpoint"
- Check your API key format: should start with "sile_"
- Ensure API key is in the X-API-Key header
- Verify your API key is active in the developer dashboard
- Check for typos or extra spaces in the API key
Rate Limit Exceeded
Error: "Rate limit exceeded - too many requests"
- Implement exponential backoff in your retry logic
- Check the rate limit headers in the response
- Consider upgrading your plan for higher limits
- For WebSocket: max 60 msgs/min, 10 burst/10sec
WebSocket Connection Issues
Error: Connection drops or authentication timeout
- Authenticate within 10 seconds of connecting
- Implement reconnection logic with jitter
- Handle heartbeat messages properly
- Check WebSocket URL format: ws://localhost:8000/ws/chat
Memory Search Returns No Results
Issue: Memory search returns empty results
- Check if memories are stored with correct contexts
- Verify memory_context array in your requests
- Allow time for embedding processing to complete
- Try broader search terms or lower relevance threshold
Debug Steps
1. Check API Health
2. Test WebSocket Statistics
3. Verify API Key Format
4. Test Basic Chat Request
Performance Tips
Memory Context Optimization
- β’ Use specific context arrays to limit search scope
- β’ Implement user-specific contexts: "private:user_123"
- β’ Consider temporal search for conversation references
- β’ Limit memory results to 10-15 for best performance
Thread Management
- β’ Create threads once and reuse them
- β’ Use thread_id for automatic message storage
- β’ Implement thread cleanup for long-running sessions
- β’ Consider session_id for sub-conversations
Getting Help
If you're still experiencing issues after trying these troubleshooting steps:
- β’ Include your request_id from error responses
- β’ Provide the exact error message and HTTP status code
- β’ Share the minimal code that reproduces the issue
- β’ Check the code examples for reference implementations