Skip to content

Memory System

Neuralgentics does not use a simple "vector search" for context. It implements a Trust-Weighted Semantic Memory system that separates raw data from verified patterns.

πŸ“ˆ The Trust Engine

Unlike standard RAG, which treats every retrieved chunk as equally valid, Neuralgentics tracks the reliability of memories.

   RAW MEMORY
       β”‚
       β–Ό
 ╔══════════════════╗
 β•‘  INITIAL TRUST   β•‘ ◄── All new memories start at 0.5
 β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
       β”‚
       β–Ό
 ╔══════════════════╗       β–² [ +0.05 ]  Agent successfully used memory
 β•‘  SIGNAL ENGINE   β•‘ ◄────── [ +0.10 ]  User explicitly confirmed
 β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•       β–Ό [ -0.05 ]  Agent ignored the memory
                            β–Ό [ -0.10 ]  User corrected the memory
       β”‚
       β–Ό
 ╔══════════════════╗
 β•‘   DECAY ENGINE    β•‘ ◄── Trust slowly fades if never used
 β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
       β”‚
       β–Ό
 [ ARCHIVE / PURGE ]  ◄── Trust < 0.3

Diagram 6 β€” Trust Scoring Pipeline. Every piece of information is a "hypothesis" until proven useful. Trust signals enable the system to remember how to solve a problem (high trust) while ignoring failed attempts from previous sessions.


μΈ΅ Tiered Memory Loading

To prevent context window saturation, Neuralgentics loads memory in three distinct tiers:

    SESSION START
          β”‚
          β–Ό
 ╔══════════════════════════════════════════╗
 β•‘ TIER 0: GLOBAL SUMMARY (~100 tokens)     β•‘ ◄── high-trust project context
 β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
          β”‚
          β–Ό
 ╔══════════════════════════════════════════╗
 β•‘ TIER 1: KEY DECISIONS (~2K tokens)       β•‘ ◄── trust β‰₯ 0.8; laws/rules
 β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
          β”‚
          β–Ό
 ╔══════════════════════════════════════════╗
 β•‘ TIER 2: FULL SEMANTIC SEARCH             β•‘ ◄── L2 full-vector retrieval
 β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

Diagram 7 β€” Tiered Memory Loading. This pyramid ensures the agent always knows the overall goal (L0) and the golden rules (L1) before diving into the specific technical details of a file (L2).


πŸ•ΈοΈ Knowledge Graph (KG)

Beyond vectors, Neuralgentics tracks relationships between entities (Projects, Files, Agents, Skills).

   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚ PROJECT  β”‚ ────── RELATED ──────► β”‚   AGENT  β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚                                  β”‚
         β”‚ SUPERSEDES                       β”‚ DERIVED_FROM
         β–Ό                                  β–Ό
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚ MEMORY A β”‚ ◄── CONTRADICTS ──── β”‚  MEMORY B β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Diagram 12 β€” Knowledge Graph Entity Model. The KG allows the system to handle contradictions. If Memory B is marked as SUPERSEDES Memory A, the orchestrator will ignore A even if its vector similarity is higher.

Relationship Types

Type Description
SUPERSEDES Replace an old decision with a new one.
PARTIAL_UPDATE Add context to an existing memory.
RELATED_TO Semantic connection without hierarchy.
CONTRADICTS Explicit conflict (triggering a dialectic resolution).
DERIVED_FROM A memory based on another (e.g., summary $\rightarrow$ detail).