DEV Community

Jonomor
Jonomor

Posted on

Building Memory for AI: The 0.0-1.0 Confidence Problem

Every AI output gets a confidence score between 0.0 and 1.0. Most systems ignore this number. I built H.U.N.I.E. because that's a fundamental mistake.

When an AI agent tells you something with 0.3 confidence, that's different from 0.9 confidence. But current systems treat both the same way. They store the output, forget the confidence, and lose the context that makes memory useful. Next session, the agent has no idea what it was uncertain about.

This creates a cascade of problems. Agents can't build on previous work. They can't identify where they were wrong. They can't pursue goals across time because they have no persistent understanding of their own reliability.

The Consolidation Engine

H.U.N.I.E. — Human Understanding Neuro Intelligent Experience — solves this with a consolidation engine that evaluates every write against existing memory. When new information comes in, the system asks: does this contradict something we already know? Is it a duplicate? What confidence level should we assign?

The architecture has two layers. A Knowledge Graph Layer stores facts and relationships with confidence scores. A Conversational Context Layer maintains session history and reasoning chains. Between them runs the consolidation engine, constantly evaluating and merging.

Here's what happens when an agent writes to memory: the consolidation engine checks for contradictions, merges duplicates, and recalculates confidence scores based on source reliability and consensus. If Agent A says "the server is down" with 0.4 confidence and Agent B confirms it with 0.8 confidence, the consolidated memory reflects higher certainty.

Cross-Property Intelligence

I'm running nine different AI properties in the Jonomor ecosystem. Each one reads from and writes to the same H.U.N.I.E. instance. This creates cross-property intelligence where insights from one system inform another.

When the code analysis agent identifies a bug pattern, the documentation agent knows about it. When the monitoring agent detects an anomaly, the debugging agent has that context. Without shared memory, each agent operates in isolation.

The system supports four query types: semantic search for conceptual matches, structured queries for specific data, graph traversal for relationship exploration, and entity lookup for direct retrieval. Each query type returns results with confidence scores and provenance.

Namespace Isolation

Different contexts need different memory boundaries. H.U.N.I.E. uses namespace isolation to separate project memory from personal memory, development context from production context. An agent working on Project A doesn't see Project B's internal details unless explicitly granted access.

This isn't just about privacy. It's about cognitive load. An agent with access to everything performs worse than one with access to relevant context. Namespace isolation maintains focus while enabling controlled sharing.

The Technical Stack

The implementation runs on TypeScript and Node.js with PostgreSQL for persistence. I chose PostgreSQL because graph operations need reliable ACID transactions. The consolidation engine processes writes asynchronously but maintains consistency guarantees.

Railway handles deployment and scaling. The system needs to be always available because every property in the ecosystem depends on it. Downtime means all agents lose their memory layer.

Why This Matters

Most AI deployments today are elaborate stateless functions. They process input, generate output, and forget everything. That works for simple tasks but breaks down for complex workflows that require learning, adaptation, and goal pursuit over time.

H.U.N.I.E. provides the missing layer: verified persistent memory with confidence tracking. Agents can build on previous work, identify and correct mistakes, and maintain context across sessions. This transforms AI from a tool that processes requests into a system that can pursue objectives.

The confidence scoring isn't just metadata. It's the foundation for self-correction and uncertainty management. An agent that knows what it doesn't know can ask better questions and make better decisions.

Try it at hunie.ai.

Top comments (0)