Aurora is a first-principles adaptive memory runtime organized around one evolving trace field. Raw events, replay, consolidation, compression, forgetting, workspace readout, and response generation operate against the same runtime state instead of a separate retrieval stack.
The repository targets single-user local deployment on Python 3.13+ and preserves four public surfaces: a Python SDK, a CLI, an HTTP API, and an MCP server. For the longer architecture reconstruction, see Aurora.md.
- A Python SDK centered on
AuroraSystem - A CLI exposed as
aurora - A FastAPI application surface for local HTTP integration
- An MCP stdio server exposed as
aurora-mcp
- Python 3.13 or newer
uv
Install the locked runtime environment:
uv sync --frozenAurora is designed for single-user local deployment.
LLM settings are only required if you call respond(...) or use a surface that can generate responses.
from aurora import AuroraSystem
system = AuroraSystem.create(data_dir=".aurora-demo")
try:
system.inject(
{
"payload": "I live in Hangzhou.",
"session_id": "session-a",
"turn_id": "turn-1",
"source": "user",
}
)
workspace = system.read_workspace(
{"payload": "Where do I live?", "session_id": "session-a"}
)
reply = system.respond(
{"payload": "What city do I live in?", "session_id": "session-a"}
)
print(workspace.active_trace_ids)
print(reply.response_text)
finally:
system.close()read_workspace(...) is side-effect free. Runtime mutations happen through inject(...), maintenance_cycle(...), respond(...), and snapshot().
Use a dedicated data directory in examples so the commands do not depend on any existing .aurora state in the current workspace.
uv run aurora --data-dir .aurora-demo inject \
--payload "I live in Hangzhou." \
--session-id session-a \
--turn-id turn-1 \
--source user
uv run aurora --data-dir .aurora-demo read-workspace \
--cue "Where do I live?" \
--session-id session-a
uv run aurora --data-dir .aurora-demo respond \
--cue "What city do I live in?" \
--session-id session-auv run aurora --data-dir .aurora-demo serve --host 0.0.0.0 --port 8000Start the MCP server with an isolated data directory. This avoids inheriting any incompatible snapshot state from an existing .aurora directory in the current workspace.
AURORA_DATA_DIR=.aurora-mcp uv run aurora-mcpAurora reads the following environment variables:
| Variable | Required | Purpose |
|---|---|---|
AURORA_LLM_PROVIDER |
For respond(...) only |
LLM provider name |
AURORA_LLM_CONFIG_BASE_URL |
For respond(...) only |
Provider base URL |
AURORA_LLM_CONFIG_MODEL |
For respond(...) only |
Model identifier |
AURORA_LLM_CONFIG_API_KEY |
For respond(...) only |
Provider API key |
AURORA_LLM_CONFIG_TIMEOUT_S |
Optional | Request timeout override |
AURORA_LLM_CONFIG_MAX_TOKENS |
Optional | Response token cap |
AURORA_API_KEY |
Optional | Bearer token for the HTTP API |
AURORA_DATA_DIR |
Optional | Runtime storage root for aurora-mcp |
Example configuration:
AURORA_LLM_PROVIDER=openai
AURORA_LLM_CONFIG_BASE_URL=https://api.openai.com/v1
AURORA_LLM_CONFIG_MODEL=gpt-4o-mini
AURORA_LLM_CONFIG_API_KEY=
AURORA_LLM_CONFIG_TIMEOUT_S=30.0
AURORA_LLM_CONFIG_MAX_TOKENS=1024
AURORA_API_KEY=
AURORA_DATA_DIR=When AURORA_API_KEY is set, every HTTP endpoint except /health, /docs, and /openapi.json requires Authorization: Bearer ....
Root exports:
AuroraSystemAuroraFieldAuroraSystemConfigFieldConfigbuild_app
Primary AuroraSystem methods:
AuroraSystem.create(...) -> AuroraSysteminject(raw_event) -> InjectResultmaintenance_cycle(ms_budget=None) -> MaintenanceStatsread_workspace(cue, k=None) -> Workspacerespond(cue) -> ResponseResultsnapshot() -> SnapshotMetafield_stats() -> FieldStatsclose() -> None
The aurora CLI exposes the following subcommands:
injectread-workspacemaintenance-cyclerespondsnapshotfield-statsserve
| Endpoint | Method | Description |
|---|---|---|
/health |
GET |
Health check |
/inject |
POST |
Inject one raw event |
/read-workspace |
POST |
Read a structured workspace |
/maintenance-cycle |
POST |
Run one maintenance cycle |
/respond |
POST |
Generate one response turn |
/snapshot |
POST |
Persist an internal snapshot |
/field-stats |
GET |
Read runtime statistics |
The aurora-mcp server exposes the following tools:
aurora_injectaurora_read_workspaceaurora_maintenance_cycleaurora_respondaurora_snapshotaurora_field_stats
Aurora treats memory as one evolving field rather than a pipeline of separate caches, summaries, and retrieval indexes.
- Raw input is packetized by mechanical boundaries and stored as anchored evidence.
- Traces are the mutable memory carriers; replay and maintenance can consolidate, split, reinterpret, or compress them over time.
- Workspace readout and response generation operate against the same field, so recall is a state readout problem rather than a separate compiled memory layer.
The public engineering surface in this repository is intentionally smaller than the full architecture discussion. For the longer first-principles reconstruction, see aurora.md.
For the contributor workflow and release-safe validation gate, see CONTRIBUTING.md.
make sync
make check
uv run pre-commit run --all-filesMIT. See LICENSE.