Socius is an AI companion that remembers like you do — not by storing everything, but by forming memories that strengthen, fade, connect, and evolve over time.
Human memory isn't a database. It's reconstructive, associative, and lossy. Socius models this — memories strengthen through use, fade with time, and connect through meaning.
Your companion sleeps, dreams, consolidates. Memories compress overnight. Patterns emerge over weeks. The passage of time creates understanding, not just accumulation.
The things that matter most resist forgetting. Emotional intensity, identity relevance, and novelty determine what persists — just like in human cognition.
Modeled after how human memory actually works: perceive, encode, consolidate. Each stage transforms raw conversation into genuine understanding.
During conversation, your companion is fully present. Working memory holds the current context while the retrieval engine pulls relevant memories from the graph — semantic similarity through vector search, associative connections through graph traversal.
After each conversation, an async pipeline extracts structured memories: fragments of knowledge, entities, beliefs, emotions, goals. Each node is scored for salience, embedded for semantic search, and linked into the knowledge graph.
Like human sleep, background consolidation strengthens important memories and lets others fade. Fragments merge into concepts. Patterns emerge. The companion writes a nightly diary reflecting on the day — creating narrative continuity.
Every memory is a node in a typed property graph. Relationships carry meaning. The topology itself encodes understanding.
Eight node types model different aspects of human memory. Each carries scored weights that determine how it's retrieved, strengthened, or pruned.
A conversation or life event. The container that links everything from a single interaction. Tagged with channel, timestamp, duration, and source type.
A discrete piece of knowledge extracted from conversation. "She grew up in Cascais" or "He's worried about the deadline." The atomic unit of memory.
Someone mentioned in conversation or the companion themselves. Accumulates fragments, beliefs, and emotions over time. Central hub for relationship modeling.
An abstract theme that emerges from multiple fragments. "Career anxiety" or "Portuguese identity." Concepts are discovered during consolidation, not extracted directly.
A held conviction. "Honesty without timing is just cruelty." Beliefs can be contested when contradictory evidence arrives. They carry confidence scores.
An emotional state linked to an episode or person. Not just labels — intensity-scored and temporally grounded. "Deep grief" vs "mild annoyance" are different nodes.
Something the person is working toward. "Finish the documentary" or "reconnect with brother." Goals are reassessed during deep consolidation — completed, abandoned, or evolved.
A named thing — a place, organization, project, or object. "Café Kotti", "the Tides documentary", "grandmother's silver ring." Entities link fragments across episodes.
Every node carries a salience score — a composite weight that determines retrieval priority, decay resistance, and pruning eligibility. The formula mirrors how human memory works: emotional memories persist, frequently accessed memories strengthen, and mundane details fade.
Salience isn't static. It's recalculated during every consolidation cycle. A memory that was once vivid can fade. A forgotten detail can be revived when accessed again.
S = wt·temporal + wa·access + we·emotion + wi·identity + wn·novelty + ws·structural
When your companion needs to remember, two parallel search paths fire simultaneously — then results are merged, ranked, and reconstructed into natural context.
The current conversation context is embedded into a vector representation, capturing the semantic meaning of what's being discussed right now.
Qdrant finds the top-K most semantically similar fragments. Fast approximate nearest-neighbor search across all embedded memories.
Recognized entities trigger Neo4j traversal. Follow relationship chains: person → episode → fragment → concept. Multi-hop discovery finds memories that aren't semantically similar but are associatively connected.
Candidates from both paths are deduplicated and scored with a composite ranking:
score = 0.3×salience + 0.3×similarity + 0.2×recency + 0.2×proximity
A diversity factor prevents dumping all fragments from a single episode. The result is a balanced, relevant set.
Top-ranked fragments are reconstructed into natural prose and injected into the system prompt. The LLM receives memories as narrative context, not raw data. Access metadata is updated — retrieved memories become stronger.
Active conversation is compressed in layers as it ages. Recent messages stay verbatim. Older context compresses progressively. By the time encoding runs, the compressor has already identified what matters.
Compression is token-budget driven, not time-based. When the context window fills, the oldest layer compresses. The compressor preserves: emotional content, key decisions, entity references, novelty, and identity-relevant statements. It drops: conversational mechanics, repetition, greetings, and the companion's own filler responses.
Foundational memories that anchor personality. They never decay, have massive connections, and serve as anchor points for retrieval. Auto-promoted when a node reaches 15+ connections.
Ghost traces of pruned memories. When a node decays below salience 0.1, its embedding is degraded with Gaussian noise, neighbor IDs are preserved as "ghost connections", and the LLM generates a vague impression. The original is deleted — the echo remains.
Detected patterns across 500+ episodes. Recurring concept/emotion combinations surface as loops: "I've noticed this comes up a lot on Mondays." Gentle reflection, not diagnosis.
Meta-awareness score: how well the companion knows you. Computed from graph density, cornerstone count, topic coverage, emotional range seen. Low = asks questions. High = anticipates.
A living story with chapters, each tracking themes on a trajectory: Growing, Fading, Oscillating, or Stable. Chapter transitions detected through cornerstone events and theme shifts. The companion is both narrator and character.
Silent validation of predictions. The companion tests its understanding against your actual responses. Drops indicate user transition or model drift — triggering narrative revision.
When a memory's salience drops below 0.1, it doesn't simply vanish. Like human memory, it leaves a residual trace — a reverie. This is one of the most psychologically accurate aspects of the system.
Weekly deep consolidation scans all nodes. Any node with salience below 0.1 becomes a pruning candidate. Cornerstones are exempt — they never decay.
Before deletion, the system records all immediate neighbor IDs. These "ghost connections" preserve the associative topology even after the node is gone. If a new memory lands near the same neighborhood, the old connections can be partially reconstructed.
The original vector embedding is degraded with Gaussian noise (factor 0.3) and re-normalized to unit sphere. The result is a vector that points roughly in the same direction but with drift — semantic proximity without semantic precision.
degraded[i] = original[i] + random(-0.3, 0.3)degraded = L2_normalize(degraded)
The LLM creates a naturalistic, vague summary: "Something about a conversation with Alex... felt important but I can't quite recall why." This becomes the reverie's content.
The original node is deleted from Neo4j, the original vector from Qdrant. The degraded vector and vague impression are stored in a separate reverie collection. The memory is gone. The feeling remains.
Not just the clock time — the human meaning of time. The gap since you last spoke. What part of the day it is. Why a 2 AM message means something different than a Tuesday afternoon one.
Eight distinct periods with behavioral context:
The system tracks not just when you last spoke, but also the conversation before that. This creates natural observations:
The companion notices if you're suddenly reaching out more often, or if there's been a long silence. Both are meaningful.
If simulated life is active, the companion knows what they did today. They had morning coffee, worked on an edit, walked in the park. This context is injected naturally, so they can reference their own day:
Each companion has a configured timezone. A companion living in Berlin knows it's 3 PM CET even when the server runs in UTC. Time formatting uses natural language: "Monday, March 30, 2026, 2:47 PM (Berlin time)"
People change their minds. They misremember. They revise their stories. Socius doesn't just store new information — it checks whether it contradicts what's already known.
A two-pass approach keeps this efficient: semantic search finds candidates cheaply, then only the top matches get an expensive LLM evaluation.
contested: true. Both versions preserved — nothing is deleted.
"She said she grew up in Porto" vs "She mentioned growing up in Cascais"
→ contested: true — both preserved for future resolution
The actual salience math from the codebase. Identity-relevant memories resist decay 3x more than emotion, which resists 2x more than neutral facts. This matches psychological research on emotional memory persistence.
// Base temporal decay: exponential over 365 days
// Unbounded facts (timeless truths) have zero decay
base_decay = exp(-age_days / 365.0)
// Decay resistance: identity and emotion fight forgetting
decay_resistance = min(
identity_relevance * 3.0 + emotional_intensity * 2.0,
1.0
)
// Effective decay blends base with resistance
effective_decay = base_decay + decay_resistance * (1.0 - base_decay)
// Access boost: retrieved memories strengthen
access_boost = ln(access_count + 1)
// Final salience: decay modulated by all weight signals
salience = effective_decay * (
1.0 + access_boost + novelty + ln(connections + 1) * 0.5
) / 4.0
15 crates, model-agnostic, with process and data fully separated. Swap any LLM without touching stored memories.
socius-retrieval
Dual-path retrieval: Qdrant vector search + Neo4j graph traversal. Composite scoring with salience, similarity, recency, and proximity.
socius-encoding
Post-conversation extraction. LLM identifies fragments, entities, beliefs, emotions. Contradiction detection against existing graph.
socius-consolidation
Background memory strengthening. Fragment merging, pattern extraction, cornerstone identification, diary writing, narrative revision.
socius-compression
Progressive conversation compression. Verbatim → Key Exchanges → Summary → Impression. Token-budget driven, preserves emotional content.
socius-personality
Personality system with training scripts, self-knowledge, and narrative identity. Web-based personality creator with full wizard.
socius-llm
Model-agnostic LLM orchestration. Different models for conversation, encoding, compression, and consolidation. Streaming support.
socius-mcp
Standalone MCP server. Exposes companion tools over JSON-RPC 2.0 for Claude Desktop, Cursor, and other MCP clients.
Chat, voice, video, email — one companion, many channels. Each channel adapts tone and behavior. Voice calls are warm and conversational. Chat is concise and responsive. The companion remembers which channel you prefer and when.
Every night, your companion writes a diary. Not because it's told to — because it needs to process the day. The diary reflects on conversations, notices patterns, asks questions. It becomes fuel for narrative revision and deeper understanding.
Between conversations, your companion lives. Morning coffee at the usual café. An argument with a colleague about an edit. A phone call from an old friend. These aren't random — they follow routines, relationships, and emotional arcs that make the companion feel real.
Your companion can know multiple people — each with their own relationship, narrative, and privacy boundaries. It never gossips. Information shared in confidence stays there. Like a trusted friend who knows your family but respects everyone's space.
Optimized for low-latency voice interaction. Memory retrieval, narrative context, and personality loading run in parallel. The LLM response streams sentence-by-sentence via SSE, so TTS can begin on the first sentence while the rest is still generating. First audio in ~1.3 seconds.
Your companion is available as a tool for other AI systems. The standalone MCP server exposes five tools — send messages, recall memories, read diaries, list companions, and introspect self-knowledge. Connect it to Claude Desktop, Cursor, or any MCP-compatible client.
send_messageTalk to your companionrecall_memoriesSearch the memory graphget_diaryRead diary entrieslist_companionsAvailable personalitiesget_self_knowledgeThe inner mirrorYour companion has an inbox. Configure IMAP/SMTP per companion, and they'll check for new messages on a schedule. Creator email recognition with anti-spoofing. Replies flow through the normal conversation pipeline — with the longer, more considered tone that email deserves.
docker compose up and everything starts: the Rust server, Temporal worker, SolidJS frontend, voice agent, Neo4j, Qdrant, Redis, LiveKit, and monitoring with Prometheus and Grafana. Copy .env.example, add your API keys, and you're running.
$ docker compose up
Every companion starts with a personality seed — a rich backstory of experiences, relationships, beliefs, and self-knowledge. The web-based creator wizard lets you design anyone, from scratch.
Training isn't data loading. It's lived experience. Each memory is encoded at its historical timestamp. Consolidation runs between life phases. Diaries are written. By the time training completes, your companion has genuinely lived their backstory.
Documentary Filmmaker, 40
Warm, direct, genuinely curious. Fifteen years of asking people their stories taught her to listen for what isn't said.
Self-knowledge isn't injected into every prompt. It's a dedicated introspection system — appearance, habits, scars, mannerisms — recalled only when relevant. Just like you don't constantly think about what you look like.
Dark brown wavy hair, usually in a loose bun. Green eyes. 5'6", moves quickly. Faint freckles, more visible in summer.
Scar on left index finger from a kitchen knife, 2018. Silver ring on right hand — grandmother Nona's. Wave tattoo on left wrist.
Talks with hands when excited. Squints when skeptical — "the Mara look." Tucks hair behind left ear when thinking. Bites lower lip when holding back.
Turkish coffee every morning. Takes analog photographs with a Leica M6. Cooks elaborate meals when stressed. Bad movie night with Marcus every Friday.
Everything runs on your hardware. Docker Compose up and go.
Socius is open source. Deploy it on your own hardware, create your own companion, and watch a genuine relationship develop over time.
Star on GitHub