Evidence-first, scoped, auditable memory for Agent Zero v2.8+.
This project implements the Neuro Core 2 plugin: capture, retrieval, and validation tools backed by SQLite, with explicit memory lifecycle and audit.
- Read the project entry documents in this order:
README.md(this file) — purpose, scope, non-goals, and where to go next.docs/ARCHITECTURE.md— component boundaries and data flow.docs/PROJECT_CONTINUITY.md— current state, known debt, change discipline.docs/AGENT_ZERO_CONTRACT_BASELINE.md— host contract and validation checklist.
- Locate the runtime plugin source at
/a0/usr/plugins/neuro_core_2/. This is the authoritative code path. The project root contains only documentation and the Agent Zero Project control plane (.a0proj/). - Review validation evidence indexed by
docs/validation/README.md. - Review durable decisions in
docs/decisions/before proposing changes.
- Framework-independent domain: immutable
Memory,Scope, lexical/trust ranking, and factor-level retrieval explanations. - Lifecycle policy:
unreviewed,validated,disputed, and terminalsuperseded; superseded memories are excluded from retrieval, not deleted. - Append-only in-process activity ledger.
MemoryStoreport with in-memory and SQLite adapters.NeuroCoreServicecomposing capture, retrieve, validation, storage, and activity events.- Standard-library tests for scope isolation, lifecycle, storage, SQLite persistence, and service flow.
- Agent Zero plugin (
neuro_core_2) withNeuroCore2Capture,NeuroCore2Retrieve, andNeuroCore2Validatetools. - Verified Agent Zero host run on 2026-08-05 with plugin identity
neuro_core_2, capture/retrieve/validate/supersede flow, cross-scope isolation, and writable SQLite store evidence. Seedocs/validation/2026-08-05-agent-zero-host-validation.md. - Verified post-restart persistence check on 2026-08-05: database survived
restart, remained writable, and capture/retrieve worked after restart. See
docs/validation/2026-08-05-post-restart-persistence-check.md. - Durable activity-event persistence in SQLite alongside memories, with a
tiny read path via
NeuroCoreService.list_activity(...). NeuroCoreService.list_activity(...)covered by a unit test for scope-filtered in-memory activity access.- SQLite schema compatibility protected by a regression test that exercises restart plus additive activity writes.
- Lifecycle hook and extension integration:
hooks.pyimplementsregister_plugin(plugin metadata: name=neuro_core_2, version=0.1.0, tools=[NeuroCore2Capture, NeuroCore2Retrieve, NeuroCore2Validate]),on_plugin_load(service initialization fromdefault_config.yaml), andon_plugin_activate(database accessibility check, startup validation, activation logging);extensions/__init__.pyregisters aSessionLifecycleExtensionatagent_initthat appends asession_initializedActivityEvent. Verified in-process only — host-level firing against a real Agent Zero host is not yet verified. - Inverted-term retrieval index: a
memory_termstable (schema version 2) is maintained on capture and used as a pure candidate pre-filter before domain scoring. Tokenization is exactlytext.lower().split(); scoring, ranking, and the inspectable-factors explanation contract are unchanged. - Bounded retrieval results:
NeuroCore2Retrievereturns at mostmax_resultsresults (default 100, configurable viamax_resultsindefault_config.yaml; the optionalmax_resultstool argument overrides the config value for a single call). The cap is applied AFTER scoring and sorting. When the full match count exceeds the cap, the payload includescount_exceeded: trueandtotal_matches: <int>so callers can distinguish truncation from exhaustion — silent truncation is prohibited.
Current state (2026-09-01): the redesigned authorization mechanism is implemented in the plugin and covered by the test suite. Enforcement is ACTIVE —
AUTHORIZATION_ENFORCEMENT_ACTIVEisTruein all three tools (capture.py:35, retrieve.py:35, validate.py:41). Host-level flag-enabled behavior has been validated by VAL (validation-report.yaml rev 1, decision: pass, required_level: host; 5/5 ARC Condition 5 scenarios on the real dispatch path; raw probe evidence under.a0proj/notepad_temp/val/20260901T0910-AUTHZ-REENABLE-VALIDATION/). The earlier integration-level pass (10/10 scenarios) is retained as historical context. Binding is not authentication; authorization remains unproven as a security mechanism, and authorization-event evidence (identity_source,denial_reason) lives on the in-memory ActivityLedger and is not durably persisted across restart (ADR-0004/ADR-0006).
- Authorization policy: a derivation-based authorization model
(operator-optional Layer 0
_tool_accessgating, plugin-side identity derivation from host inputs that exist at dispatch, scope binding with theagent:Nonesentinel, audited fallback with theidentity_sourcemarker, service-layer scope check, authorization audit with denial reason) is implemented to enforceScope(project, agent)isolation at the tool-invocation level; enforcement is ACTIVE (AUTHORIZATION_ENFORCEMENT_ACTIVE = Truein all three tools). Integration-level behavior was validated on the real host dispatch path (VAL pass, 10/10 scenarios, retained as historical context), and host-level flag-enabled effectiveness is now validated by VAL (validation-report.yaml rev 1, decision: pass, required_level: host, 5/5 ARC Condition 5 scenarios on the real dispatch path). Binding is not authentication:agent_nameandprofileare host-controlled binding factors, not credentials. This is a minimal baseline with explicit non-claims (not a security boundary, not caller authentication, not production-grade); authorization-event evidence (identity_source,denial_reason) is recorded on the in-memory ActivityLedger and is not durably persisted across restart (ADR-0004/ADR-0006); the maturity limit ("authorization is unproven") remains in Project Instructions §1. Seedocs/AGENT_ZERO_CONTRACT_BASELINE.md"Authorization contract" anddocs/decisions/0008-authorization-policy.md(ADR-0008, superseding ADR-0007 in full).
- Performance, concurrency, security, benchmark, or competition claims. Do not assert these as completed.
- Durable cross-session audit querying surface beyond the service method.
- Tool configuration sourced from
default_config.yamlinstead of hardcoded paths (design intent; implementation may still be evolving). - Actual Agent Zero host lifecycle firing (the real framework calling
on_plugin_load/on_plugin_activate/register_extensionas part of its own plugin loading sequence) is not exercised. Only in-process code-path verification was performed.
- Keep Agent Zero imports in
plugins/neuro_core_2/; root modules must remain host-independent. - Treat
Scope(project, agent)as a hard isolation boundary. - Preserve inspectable ranking factors when replacing lexical retrieval with semantic/vector retrieval.
- Preserve superseded records for audit; do not retrieve them.
- Add storage backends behind
MemoryStore, not directly in the service. - Keep explicit tool scope inputs unless a documented host-session mapping is proven.
- Ranking is a correctness baseline, not semantic retrieval.
- SQLite opens per invocation and has no migration or concurrency strategy.
- Tool code should load the plugin-local database path from
default_config.yamlat runtime. - Activity events are durably appended when the underlying store supports it, but cross-invocation audit querying is not yet exposed as a tool.
- The installer copies files but does not validate imports, discovery, permissions, or manifest behavior.
- There is no input-size control, observability, or evaluation harness.
- Authorization is implemented as a minimal baseline (derivation-based
model per ADR-0008, superseding ADR-0007 in full) with explicit
non-claims (not a security boundary, not caller authentication, not
production-grade) and the maturity limit ("authorization is unproven")
preserved in Project Instructions §1. Integration-level validation has
passed (VAL, 10/10 scenarios, retained as historical context);
enforcement is now ACTIVE (
AUTHORIZATION_ENFORCEMENT_ACTIVE = Truein all three tools), and host-level flag-enabled behavior is validated by VAL (validation-report.yaml rev 1, decision: pass, required_level: host, 5/5 ARC Condition 5 scenarios on the real dispatch path). Authorization-event evidence remains in-memory only (ActivityLedger; not persisted across restart, ADR-0004/ADR-0006). The declared-name dispatch mismatch (NeuroCore2Capture/NeuroCore2Retrieve/NeuroCore2Validateare not resolvable via filename-based host dispatch; tools are reachable only under their snake_case names) is a known constraint. Seedocs/AGENT_ZERO_CONTRACT_BASELINE.md"Authorization contract" anddocs/decisions/0008-authorization-policy.md. - Lifecycle integration code is implemented, but host-level firing (real Agent Zero framework load/activate/agent_init invocation) remains unverified.
No environment variable is currently required to install, configure,
or run Neuro Core 2. A read-only inspection of the runtime plugin source
(/a0/usr/plugins/neuro_core_2/) for os.environ, getenv, and
environ[...] references returned no matches. All configuration is read
from the plugin-local default_config.yaml at
/a0/usr/plugins/neuro_core_2/default_config.yaml. If a future change
introduces an environment-variable prerequisite, it must be documented
here and in docs/AGENT_ZERO_CONTRACT_BASELINE.md before being required.
The runtime plugin source has no third-party Python dependencies.
A read-only inspection of /a0/usr/plugins/neuro_core_2/ for import
statements confirmed only standard-library modules are imported by
production code (sqlite3, json, dataclasses, datetime, pathlib,
typing, hashlib, uuid, re, os, sys, collections, abc,
functools, itertools, threading, unittest, tempfile).
Development tooling dependency: the git pre-commit hook at
scripts/hooks/pre-commit requires PyYAML 6.0.3 (third-party) to
validate YAML parseability of staged files. This dependency is needed
only for contributors who install the hook locally; it is not required
to install, configure, or run the plugin itself. Install with:
pip install 'PyYAML==6.0.3'The hook's six unit tests (tests/test_precommit_yaml_hook.py) also
require PyYAML. If a future change introduces a runtime dependency, it
must be documented here and in docs/AGENT_ZERO_CONTRACT_BASELINE.md
before being required.
/a0/usr/projects/neuro_core_2/
├── README.md # this file (project-root entry)
├── docs/
│ ├── ARCHITECTURE.md # component boundaries
│ ├── PROJECT_CONTINUITY.md # current state, debt, discipline
│ ├── AGENT_ZERO_CONTRACT_BASELINE.md # host contract & checklist
│ ├── validation/
│ │ └── README.md # index of validation evidence
│ └── decisions/
│ └── ADR-001-record-format.md # durable decision records
└── .a0proj/ # Agent Zero Project control plane
├── instructions/ # project instructions & schemas
├── team/ # workflow state & work items
├── decision_log/ # non-negotiable decisions log
└── notepad_temp/ # non-authoritative scratch
The runtime plugin source lives at /a0/usr/plugins/neuro_core_2/ and
contains the actual code, tests, installer, and runtime docs. The project
root contains only the newcomer-facing documentation and the Agent Zero
Project control plane.
Every behavior change needs a unittest update. Record lifecycle,
ranking, or public-contract decisions in docs/decisions/. Preserve
constructor and port compatibility or provide a deliberate migration.
Keep implemented, planned, and unverified behavior clearly separated.
For deployment work, record the Agent Zero version/commit, install
command, plugin discovery result, capture/retrieve/validate inputs and
outputs, database path, test output, and deviations in a dated issue,
PR, or docs/validation/ artifact.