Software Engineer & Independent AI Researcher

Matheus Pereira

Exploring memory, intelligent agents, and systems built to evolve.

I investigate how intelligent and conventional systems preserve context, coordinate decisions, and remain understandable as they evolve over time.

Portrait of Matheus Pereira
Portrait of Matheus Pereira

About me

Engineering systems. Investigating intelligence.

I am Matheus Pereira, a software engineer and independent AI researcher working at the intersection of software architecture, memory systems, and intelligent agents.

I build practical software and investigate how intelligent systems preserve context, coordinate decisions, form interpretable representations, and evolve without losing coherence.

More about me

Current investigations

Research that treats memory and architecture as living systems.

View all research →

Artificial Intelligence and Memory Architectures

DREAM

DREAM is a model-independent architecture for persistent, opt-in, and governed episodic memory in artificial intelligence agents. It investigates how long-running systems can preserve useful continuity without allowing accumulated memories to become an uncontrolled source of outdated assumptions, semantic drift, recursive reinforcement, or false coherence. The architecture evolved from adaptive retention and lifecycle management toward explicit governance of memory influence. Its central principle is that retaining or retrieving a memory does not automatically authorize that memory to influence current reasoning. DREAM therefore treats persistence, retrieval, authorization, consolidation, correction, and deletion as distinct architectural responsibilities. The current version includes a Python reference implementation, formal data contracts, automated tests, a local governance playground, controlled synthetic benchmarks, component-ablation experiments, and auditable decision traces.

Software Architecture and Sustainability

Legacy-First Design

Legacy-First Design (LFD) is a conceptual software architecture methodology that treats time as a primary design constraint. It distinguishes between permanent elements, which preserve the identity and essential behavior of a system, and transient elements, such as frameworks, databases, protocols, and infrastructure, which must remain replaceable. Through six fundamental principles, LFD proposes that software should preserve meaning, resist technological obsolescence, evolve without losing its identity, remain understandable to future maintainers, and continue to make sense during prolonged periods without maintenance. Rather than replacing established approaches such as Clean Architecture, Domain-Driven Design, or Hexagonal Architecture, LFD provides temporal criteria for deciding what must endure and what may change.

Artificial General Intelligence and Cognitive Architectures

MQ-AGI

MQ-AGI is a neuroinspired, modular, and quantum-extended architecture for Artificial General Intelligence. It proposes an alternative to increasingly large monolithic models by separating perception, specialized reasoning, memory, integration, metacognition, and safety into components with explicit responsibilities. The architecture combines Domain Expert Networks, a Global Integrator Network, hierarchical long-term memory, distributed orchestration, and a quantum-inspired optimization core. Specialized experts generate parallel hypotheses, while the integrator constructs a coherent working representation, resolves conflicts, coordinates memory retrieval, and supports deliberative reasoning. Rather than sending large volumes of raw data to a quantum processor, MQ-AGI reserves quantum or quantum-inspired computation for bounded combinatorial problems such as expert-coalition selection, hypothesis optimization, and constraint satisfaction. This design reduces exposure to the quantum data-loading bottleneck while establishing a possible development path through classical emulation, NISQ-era optimization, and future quantum-native components. The research includes an architectural proposal, a mathematical formalization based on QUBO and Ising Hamiltonians, category-theoretic integration, and active inference, as well as a critical theoretical evaluation of its scientific coherence, engineering limitations, and long-term feasibility.

Papers, notes & articles

Published thinking.

View all thinking →
Oct 18, 2026
Article / Artificial Intelligence

When Interpretability Costs Accuracy: Lessons from HGC-Net

HGC-Net explores whether a neural network can expose meaningful human concepts without forcing every useful representation through a fully interpretable bottleneck.

Read →
Sep 10, 2026
Article / Software Architecture

Legacy-First Design: Building Software That Outlives Its Technology Stack

Legacy-First Design treats time as a primary architectural constraint. By separating the permanent identity of a system from its replaceable technologies, LFD proposes a way to build software that remains coherent long after its original stack, team, and context have changed.

Read →
Oct 10, 2026
Article / Software Architecture

A Browser Is More Than a WebView: Designing Trust Boundaries in Rust

Rendering a web page is the easy part. The real challenge begins when untrusted remote content shares an application with native services, persistent state, and privileged internal tools.

Read →
Sep 19, 2026
Article / dream-v3-governed-ai-memory

A Memory Can Be Stored Without Being Trusted: Inside DREAM v3

DREAM v3 separates memory retention from cognitive influence, introducing provenance, contradiction handling, epistemic hygiene, controlled context construction, and auditable decision traces for persistent AI memory.

Read →
Sep 24, 2026
Article / Software Architecture

Software Contracts Show Structure. Raygon Makes Dependency Explicit.

Traditional software contracts describe what is available, but rarely reveal what each consumer actually depends on. Raygon explores a projection-based model in which dependency, compatibility, and evolution become explicit and observable.

Read →