Skip to main content
The AveniECA REST API provides programmatic access to all ECA functionality through a Python client.

ECA Class

The ECA class is the main entry point for interacting with the REST API. It initializes all API endpoints and handles authentication.

Initialization

from avenieca.api.eca import ECA
from avenieca.api.model import Config
import os

config = Config(
    uri="http://localhost:2580/v1",
    username=os.getenv("USERNAME"),
    password=os.getenv("PASSWORD")
)

eca = ECA(config)

Available Endpoints

The ECA class provides access to the following API modules:
  • eca.ess - Episodic State Storage management
  • eca.sequence - Sequence management
  • eca.cortex - Prediction API
  • eca.document - Document management
  • eca.embedding - Embedding input management
  • eca.retrieval - Natural language query interface
  • eca.response - ECA response management

Quick Example

import os
from avenieca.api.eca import ECA
from avenieca.api.model import Config, ESSInsert

# Initialize client
config = Config(
    uri="http://localhost:2580/v1",
    username=os.getenv("USERNAME"),
    password=os.getenv("PASSWORD")
)
eca = ECA(config)

# Create an ESS entry
ess = ESSInsert(
    module_id="air_conditioner",
    state=[11],
    valence=10.0,
    score=4,
    embedding_input=1
)
res, status = eca.ess.create(data=ess)
print(f"Created ESS with ID: {res.id}")

Response Format

All API methods return a tuple of (response, status_code):
response, status = eca.ess.get_one(module_id="air_conditioner", db_id=1)

if status == 200:
    print(f"ESS ID: {response.id}")
    print(f"State: {response.state}")
else:
    print(f"Error: {response.errors}")

Next Steps

Build docs developers (and LLMs) love