Skip to content

Classification System ​

abmind uses a NATO Admiralty Code-inspired system to rate memory reliability and control access. Every extracted memory carries three quality scores and a classification level.

Classification Levels ​

ClassNameAccessEncryptionExample
0PublicAll rolesNoneGeneral facts, preferences
1Internaluser + masterNonePersonal details, work context
2Confidentialuser + masterNoneSensitive decisions, private opinions
3Secretmaster onlyAES-256-GCM at restAPI keys, passwords, credentials

Default classification for new memories: 1 (Internal).

Access control ​

Recall queries include maxClassification (derived from the user's role):

  • master → sees class 0–3
  • user → sees class 0–2
  • guest → sees class 0 only

Class 3 memories are encrypted in the database. They're decrypted only when recalled by a master-role user, and only via explicit tool call (never auto-injected into context).

Quality Scores ​

Trust (source reliability) ​

How reliable is the source of this information?

ScoreMeaningAssigned when
0UnknownDefault for new memories
1UnreliableContradicted by other evidence
2Fairly reliableSingle unconfirmed source
3ReliableConfirmed by user or multiple sources

Integrity (information accuracy) ​

How accurate is the information itself, independent of source?

ScoreMeaningAssigned when
0UnknownDefault
1DoubtfulContradicts known facts
2Possibly truePlausible but unconfirmed
3Probably trueConsistent with other memories
4ConfirmedExplicitly verified by user

Default: 2 (Possibly true).

Credibility (combined assessment) ​

Composite score combining trust and integrity. Used as a ranking multiplier in recall:

ScoreEffect on recall ranking
≤ 21.25× boost (high credibility)
3–41.0× (neutral)
≥ 51.0× (neutral — no penalty, just no boost)

Lower credibility number = more credible. Scale: 0 (highest) to 6 (lowest).

Default: 6 (unassessed).

How scores affect recall ​

The Sf stage scoring formula includes:

trust_factor = 0.5 + 0.5 × (trust / 3)
credibility_factor = 1.25 if credibility ≤ 2, else 1.0

A memory with trust=3, credibility=1 gets a 1.0 × 1.25 = 1.25× boost over an unscored memory (trust=0, credibility=6 → 0.5 × 1.0 = 0.5×).

Setting scores ​

Automatic (during extraction) ​

The sleep cycle's extraction step assigns initial scores based on:

  • Source: user-stated facts get higher trust than inferred ones
  • Confidence: LLM extraction confidence maps to integrity
  • Type: secrets auto-classify as class 3

Manual (at store time) ​

bash
abmind store --translated "fact text" --original "fact text" --memory-type fact --emotion-score 0 --user-id <id> --classification 2

Via tool call (agent-initiated) ​

The memory_store tool accepts a classification parameter at store time. Direct reclassification via an edit command is retired; classification is assigned when the memory is stored. Trust, integrity and credibility are retired in favor of authority and provenance.

Multi-user isolation ​

Classification enforcement is per-query, not per-memory. The same memory can be visible to one user and hidden from another based on their maxClass setting.

json
{
  "users": [
    { "userId": "admin", "role": "master", "maxClass": 3 },
    { "userId": "colleague", "role": "user", "maxClass": 1 }
  ]
}

In this setup, colleague sees only class 0–1 memories. Class 2–3 memories exist in the same database but are filtered out at query time.

Encryption (Class 3) ​

Class 3 memories use AES-256-GCM encryption:

  • Key stored at ~/.abmind/secret/abmind.key (chmod 600)
  • Each memory gets a unique IV
  • Encrypted value stored in content_original (base64-encoded ciphertext + auth tag); a plaintext description stays in content_en for discovery

Commands:

bash
abmind list-secrets       # show metadata (no decryption)
abmind rekey --old-key /path/to/old.key   # re-encrypt with new key

Upgrading classification ​

Direct reclassification via abmind edit is retired with the legacy edit surface. Store the memory at the intended classification instead; secrets auto-classify as class 3.