Skip to main content

Admin Storage

The admin package persists entity blueprints to a StorageDriver, ensuring they survive server restarts. Any storage backend supported by @radaros/core works.

Storage Backends

import { InMemoryStorage } from "@radaros/core";
import { createAdminRouter } from "@radaros/admin";

const { router, hydrate } = createAdminRouter({
  storage: new InMemoryStorage(),
});
Data is lost on server restart. Use for development only.

How It Works

The admin layer uses four namespaces to organize data:
NamespaceContents
radaros:admin:agentsAgentBlueprint objects
radaros:admin:teamsTeamBlueprint objects
radaros:admin:workflowsWorkflowBlueprint objects
radaros:admin:toolkit-configsToolkitConfig objects (credentials, settings)
Each record is stored as a plain JSON object keyed by the entity’s name (or instanceName for toolkit configs). No class instances or functions are persisted — only serializable configuration.
Toolkit configs may contain sensitive values (API keys, tokens). These are stored as-is in the storage driver. Use an encrypted-at-rest storage backend (e.g., PostgreSQL with disk encryption) for production deployments. API responses always mask secret fields.

Hydration Flow

On server startup, call hydrate() to restore entities:
Server starts

hydrate()

ToolkitManager.hydrate()  →  Instantiate enabled toolkit configs  →  Tools available
ConfigStore.listAgents()   →  EntityFactory.createAgent()          →  registry.add()
ConfigStore.listTeams()    →  EntityFactory.createTeam()           →  registry.add()

Transport layer discovers all entities via registry

Ready to serve requests
Toolkit configs are hydrated first (so their tools are available), then agents (which may reference those tools), then teams (which reference agents). Entities already in the registry are skipped.

Sharing Storage

The admin storage can use the same StorageDriver instance as your agents’ memory and sessions. Namespaces prevent collisions:
const storage = new PostgresStorage("postgresql://localhost:5432/radaros");

// Admin uses radaros:admin:* namespaces
const { router, hydrate } = createAdminRouter({ storage });

// Agents use radaros:sessions:*, radaros:memory:* namespaces
const agent = new Agent({
  name: "bot",
  model: openai("gpt-4o"),
  memory: { storage },
});