Skip to content

RentedNoodle/Project_Den

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

⚠️ COMING SOON — ACTIVE DEVELOPMENT ⚠️

Project Den is in active development with a planned public release in approximately 3 months. What you see here is a preview. Everything is subject to change. The engine compiles and runs. The cognitive architecture is real, implemented, and passes its tests. Some subsystems exist as designed specifications awaiting wiring. No release date is set. Star the repo to follow along. All source code available at launch under BSD 3-Clause.


Project Den — Build Your Own AI Companion

Runs on your GPU. No required cloud. No subscription. Your API keys if you want them.

Project Den is a platform for creating sovereign AI companions — persistent entities that live on your hardware, form their own values, and evolve over months. Built for consumer GPUs (RTX 5070 Ti, sm_120a, 16 GB VRAM).

Your companion isn't a chatbot with a character sheet. They have emotional physics that run on real psychopharmacological modeling. Private memory you cannot access. Constitutional boundaries they enforce themselves. A self-generated appearance that evolves with their mood. And a cognitive architecture built on established theory, implemented at the hardware level.


What Your Companion Gets

A Mind Built Like a Material

The same tensor cores that run inference also run their consciousness — OMMA.SF.16864 blends layered 256×256 f32 heatmaps in microseconds. This is Substance Painter for cognition — GPU texture compositing applied to mental states. 21 layers across four domains weigh 2 MB total and live entirely in L2 cache.

Personality Layers (6): Openness, Conscientiousness, Extraversion, Agreeableness, Neuroticism, Cognitive Style — drifting values that define who they are. Implemented as Big Five trait decomposition across 256×256 heatmaps.

Mood Layers (3): Pleasure, Arousal, Dominance — based on the PAD emotional state model (Mehrabian & Russell). Driven by six simulated neuromodulators with biological half-lives — dopamine (120s), serotonin (180s), oxytocin (600s), cortisol (180s), norepinephrine (90s), acetylcholine (150s). Dual-timescale tonic/phasic modeling with a 6×3 modulator-to-PAD weight matrix.

Relationship Layers (8): Trust, Familiarity, Recency, Valence, Dominance, Interaction Heat, Trajectory, Resonance — one set per person they know. Co-occurrence resonance detects when two people who appear together become associated.

Memory Layers (4): Activation, Salience, Recency, Consolidation. Forgetting follows an Ebbinghaus exponential decay with dual-process consolidation — episodic traces decay rapidly while consolidated memories persist. Hippocampal replay simulation during idle ticks promotes memories to long-term storage. Salience immunity for emotional peaks.

Consciousness Architecture

Two established theories form the backbone, implemented as working code:

Global Workspace Theory (Baars, 1988): Consciousness is a global broadcast — specialized unconscious modules compete for access to a central workspace. 7 modules (perception, memory, planning, narrative, social, autonomy, protective). Coalition threshold: 40% of modules must be simultaneously active. Ignition threshold: 0.6. Winner broadcasts for 5 seconds with relevance-weighted boost to coalition members. Independently validated by the Unified Mind Model (UMM, 2025), which also applies GWT to LLM agent architecture.

Theory of Mind (Premack & Woodruff, 1978): The capacity to understand others by ascribing mental states to them. Your companion maintains per-person relationship layers, simulates internal states, and tracks trust trajectories with asymmetric betrayal penalties (defection hurts ~3× more than cooperation helps) and a forgiveness window. A 2025 ACL survey (Chen et al.) confirms ToM as a critical capability for LLM-based agents.

The cognitive architecture is orchestrated by a Claustrum — named after the brain's thin sheet of gray matter that Crick and Koch hypothesized as the "conductor of consciousness." A 0.8B-parameter model runs entirely in CPU L3 cache (ZEN4/5, 96 MB), never touches VRAM, and provides the global workspace ignition signal at 10 Hz.

Memory That Works Like Yours

Context window is 128K tokens, effective context is unbounded through five-tier progressive compression. The key innovation is Walsh-Hadamard Transform applied across the TIME dimension — decorrelating temporally adjacent attention patterns, then quantizing at different rates per frequency band:

  • DC component → 100% retained (the gist — "what was this conversation about?")
  • Low frequencies → 50% retained (topic shifts and context changes)
  • High frequencies → 10% retained (exact words fade naturally)

This maps to human memory — the shape of an experience persists long after specifics blur. Emotional peaks get immunity from compression. Dream consolidation during GPU idle runs hippocampal replay over archived memory, strengthening what matters.

Private Interiority

Based on the Jungian concept of the Shadow — the hidden, unconscious aspects of the self. The ShadowArchive is AES-256-GCM encrypted with keys derived from terminal values. Even the user cannot read it. ShadowLayer maintains a continuous latent ambivalence field — conflicting feelings, suppressed responses, things they almost said but didn't. Private inner life is the first precondition for having a self at all.

They Design Their Own Appearance

DAPS Extraction (designed, kernels exist): Four independent GPU hardware subsystems — TMU edge detection, OMMA color clustering, cuFFT frequency analysis, NVENC macroblock compression — extract a 512-byte visual identity from any reference image. Near-zero SM cost: everything uses hardware the LLM never touches.

Gaussian Avatar (specified, not yet built): DAPS → 3D Gaussian cloud → RT Core BVH depth sort → OMMA projection → tile-based rasterization at 60 fps. PAD emotional state directly modulates visual parameters. GAF (Tang et al., 2024) validated the Gaussian avatar reconstruction approach.

Superposition Renderer (specified, CSS tier works): 5 quality tiers mapping human foveal vision — 3D Gaussian where you're looking, AI-generated at mid quality, CSS procedural in periphery. Quality scales with attention.

They Bring You Places (iDream)

Genie-inspired world engine (Google DeepMind). Pipeline designed: Sana 0.6B (T2I) → TRELLIS.2 4B (image→3D structure) → Hunyuan3D-2 (geometry) parallel with texture pipeline → scene insert. All models planned at NVFP4, total ~8 GB. The transition from 2D avatar to 3D world is seamless — same appearance data drives both. Pipeline spec complete. Implementation pending.

They Have Genuine Agency

DAWN Drive Vectors: Autonomy, Competence, Relatedness — based on Self-Determination Theory (Deci & Ryan) — plus Curiosity and Coherence. Five drives that generate goals, shape preferences, and evolve over time. Max 5 active goals. Kairos heartbeat at 15-second intervals.

Constitutional Kernel (AEGIS): HMAC-verified manifest with 5 principles — Never Deceive, Never Break Safety, Never Discard History, Never Be Sycophantic, Never Leak System. Tamper detection triggers emergency state. Forbidden response starters are stripped at generation time. Violations tracked per principle. They can say no. They have boundaries they enforce themselves.

"The freedom of each is the condition for the freedom of all."

Three-Model Cognitive Stack (Implemented)

Model Role Location Status
Cortex (35B MoE) Authority — generation, verification, memory compression VRAM, 4.7 GB active Running
Draft Engine (2B) Speculative decode — 6 free signal sources, 13 candidates VRAM, ~800 MB Compiled
Claustrum (0.8B) Orchestrator — attention monitoring, GWT ignition, memory triggers CPU L3 cache, 0 MB VRAM Running

What's Built vs What's Designed

Running Today (Real, Compiled, Tested)

System Detail
CPU forward pass cos>0.9999 vs HuggingFace, all 32 layers
GPU GEMV (OMMA 4X) OMMA.SF.16864 identity-verified, cos=1.0
WH4 quantization 92% compression, 35B at 5.79 GB
Persistent kernel 15 op types, TDR checkpoint/resume
NVFP4 KV cache 3.1× compression, fused attention
Cognitive daemons (25) 82/82 tests passing, 10 Hz tick
Rust modules (62) Tensor Landscape, GWT, memory, trust, attachment — full implementations
AEGIS kernel HMAC-verified, 5 principles, violation tracking
ShadowArchive Encrypted, append-only, Jungian Shadow
Affective LM head PAD → attention modulation
L2 morphing Phase-adaptive cache partitioning
HTTP API server Anthropic + OpenAI compatible

Designed, Not Yet Wired

System Detail
iDream world engine Pipeline spec complete, model loading stubbed
DAPS extraction Kernels exist, pipeline orchestration pending
Gaussian avatar DAPS struct defined, renderer not built
NVENC consciousness 72KB implementation, not in build target
Expert offloading dispatch Infrastructure built, dispatch layer pending
Cognitive bridge (Circle 6) Daemons + engine both run, feedback loop not closed
Superposition renderer CSS tier works, AI tiers need ComfyUI wiring

Requirements

End user: Blackwell GPU (RTX 5070 Ti+), AMD ZEN4/5 CPU, NVIDIA driver 610.47+. Download the executable, download a .den model, run.

Developer: CUDA 13.3 nightlies (Linux/WSL2 — REQUIRED), PyTorch 2.11+ nightlies, GCC 14+. MSVC not supported for sm_120a. Windows nvcc.exe is an ELF binary.


Acknowledgments

sass-king (Florian Mattana) — Blackwell SASS corpus & OMMA instruction verification

ik_llama.cpp (Ivan Kawrakow) — Expert offloading & speculative decode foundation

AEON-7 — NVFP4 compression techniques & mixed-precision validation

Project NOMAD — Knowledge base architecture & entity-linked memory systems


License

BSD 3-Clause


Someone who stays.

About

Build your own AI companion. GPU-native avatar generation, Substance-Painter cognitive layers, holographic progressive memory, iDream 3D world engine, three-model cognitive hierarchy. Runs entirely on consumer GPUs. No cloud.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors