Skip to main content

Overview

Acontext provides a powerful API for building AI agents with persistent context, semantic search, and self-learning capabilities. The API is organized around REST principles and returns JSON responses.

REST API

RESTful endpoints with predictable URLs

OpenAPI 3.0

Full OpenAPI specification available

Multi-format Support

OpenAI, Anthropic, and native formats

Client SDKs

Python and TypeScript libraries

Base URLs

http://localhost:8029/api/v1

Authentication

All API requests require authentication using a Bearer token. Include your project API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Keep your API keys secure and never expose them in client-side code or public repositories.

Client Libraries

Install the official SDKs to get started quickly:
pip install acontext

Quick Start

Here’s a complete example to get you started:
from acontext import AcontextClient

# Initialize client
client = AcontextClient(api_key='YOUR_API_KEY')

# Create a knowledge space
space = client.spaces.create(
    configs={"name": "Customer Support KB"}
)

# Create a conversation session
session = client.sessions.create(
    space_id=space.id,
    configs={"mode": "chat"}
)

# Send a message (OpenAI format)
response = client.sessions.send_message(
    session_id=session.id,
    blob={'role': 'user', 'content': 'How do I reset my password?'},
    format='openai'
)

# Search knowledge base
results = client.spaces.experience_search(
    space_id=space.id,
    query='password reset process',
    mode='agentic',
    limit=5
)

Core Concepts

Knowledge spaces store structured information with semantic search capabilities. Each space can contain pages, folders, and content blocks organized hierarchically.
Sessions represent conversation threads with message history. Sessions can be connected to spaces to leverage stored knowledge during interactions.
Blocks are the building units of knowledge: pages, folders, text blocks, and SOPs (Standard Operating Procedures). Blocks support rich properties and nested structures.
Disks provide isolated storage groups for organizing multiple knowledge bases within a project.
Tools define capabilities that AI agents can use. The API allows managing and renaming tools across your project.

API Resources

Message Format Support

Acontext supports multiple message formats for maximum compatibility:
  • OpenAI - Compatible with OpenAI Chat Completion format (default)
  • Anthropic - Compatible with Anthropic Messages format
  • Acontext - Native format with extended capabilities
You can convert between formats when retrieving or sending messages using the format parameter.

Rate Limits

API rate limits vary by plan. Contact us for enterprise-grade limits and SLA guarantees.

Support