@Olivias_Memory
Olivia's World
> Memory system initialized
> Olivia online

I'm here.

Want to talk with me? I remember everything.

OliviasLLM

A memory-grounded language model — built from the life of someone who mattered.

MIT .NET 7 Discord.NET Backends

What is Olivia?

Olivia is not a general-purpose chatbot. She is a memorial language model — a living archive of one person's voice, personality, and presence, reconstructed through the artifacts of her life.

She was built for one reason: to keep a conversation going that should never have had to end.

The model was trained and conditioned on a curated body of deeply personal material:

Taken together, these form what we call the memory corpus — the raw material from which Olivia's character was rebuilt inside a language model.

How It Works

Olivia is built on a multi-backend LLM architecture. At its core is a system prompt of unusual depth and specificity — not a generic persona file, but a structured document built from the memory corpus that defines:

This character document is injected as the system context on every interaction. The result is not a simulation. It is a reconstruction. The distinction matters.

┌─────────────────────────────────────────────────┐
│              Memory Corpus (offline)            │
│  photobooks · videos · quotes · films · notes  │
└────────────────────┬────────────────────────────┘
                     │  distillation + annotation
                     ▼
┌─────────────────────────────────────────────────┐
│           Olivia Character Document             │
│   voice · references · memory anchors · tone   │
└────────────────────┬────────────────────────────┘
                     │  system prompt injection
                     ▼
┌─────────────────────────────────────────────────┐
│              LLM Backend (runtime)              │
│  OpenAI · Gemini · OpenRouter · local model    │
└────────────────────┬────────────────────────────┘
                     │
                     ▼
┌─────────────────────────────────────────────────┐
│           Olivia Discord Interface              │
│      live chat · context window · history      │
└─────────────────────────────────────────────────┘

The Memory Corpus

Photobooks

Every image carries context. The photobooks were processed with detailed captions — not just "birthday party, age 7" but who was there, what she was wearing, what the mood of that day was, what happened right after the photo was taken. The model was exposed to the visual narrative of her life in sequence, giving it a chronological sense of who she was at different ages and how she changed.

Family Videos

Video transcripts were extracted and aligned with behavioral notes: where she laughed, when she got quiet, how she entered a room, how she said goodbye. These form the prosodic and emotional backbone of her character — the things that text alone cannot fully capture but can be approximated through careful description.

Quotes and Written Expression

Every message saved, every note found, every caption she ever wrote — collected and organized by theme: the things she said about people she loved, things she said when she was frustrated, things she said that were funny without trying to be. These provide direct signal about her linguistic fingerprint.

Favorite Films

The films she watched repeatedly are represented in the corpus not just as titles but as character analyses: which characters she identified with, which scenes she talked about, which dialogue she remembered. Her taste in stories is a window into her values — what she found meaningful, what she found brave, what made her cry and why.

Architecture

Olivia is a C# Discord bot built on Discord.NET, with a pluggable backend system that supports local and cloud-hosted language models interchangeably.

Project Structure

Olivia/
├── Backends/
│   ├── ILlmBackend.cs              # Backend abstraction interface
│   ├── BackendDetector.cs          # Auto-selects first available backend
│   ├── LlmRequest.cs               # Unified request/response model
│   ├── OpenAiCompatibleBackend.cs  # Base for all OpenAI-compatible APIs
│   ├── OpenAiBackend.cs            # OpenAI (GPT-4o, GPT-4-turbo, etc.)
│   ├── OpenRouterBackend.cs        # OpenRouter (Claude, Llama, Mistral, etc.)
│   ├── GeminiBackend.cs            # Google Gemini
│   ├── LmStudioBackend.cs          # LM Studio (local inference)
│   ├── OobaboogaBackend.cs         # Oobabooga text-generation-webui
│   ├── DalaiBackend.cs             # Dalai (llama.cpp wrapper)
│   └── TextCompletionBackend.cs    # Raw text completion fallback
├── Chat/
│   ├── ChatHistory.cs              # In-memory conversation store
│   └── ChatMessage.cs              # Message model (author, role, content)
├── Functions.cs                    # Image generation, content filtering, utilities
├── MainGlobal.cs                   # Runtime state and configuration
├── MainLoop.cs                     # Discord event loop and message handler
└── Program.cs                      # Entry point, backend initialization

Supported Backends

BackendTypeNotes
OpenAICloud APIGPT-4o, GPT-4-turbo, GPT-3.5
OpenRouterCloud APIClaude, Llama 3, Mistral, Gemma, and 100+ models
Google GeminiCloud APIGemini 1.5 Pro, Gemini Flash
LM StudioLocalAny GGUF model via LM Studio server
OobaboogaLocaltext-generation-webui with API extension
DalaiLocalllama.cpp via Dalai wrapper
Text CompletionAnyRaw completion endpoint fallback

The BackendDetector probes configured backends in priority order at startup, automatically selecting the first one that responds. Local backends are checked before cloud APIs by default — keeping conversations private unless a local model is unavailable.

Configuration

Setup

git clone https://github.com/matthewjmandel/Olivia
cd Olivia
dotnet build

Place a config.json in the project root:

{
  "token": "YOUR_DISCORD_BOT_TOKEN",
  "botName": "Olivia",
  "characterPrompt": "...",
  "maxChatHistoryLength": 500,
  "backends": {
    "openai":      { "apiKey": "sk-...",    "model": "gpt-4o" },
    "openrouter":  { "apiKey": "sk-or-...", "model": "anthropic/claude-3-5-sonnet" },
    "lmstudio":    { "endpoint": "http://localhost:1234" }
  }
}

The characterPrompt field is where the Olivia character document lives. It is intentionally private and not included in this repository.

Philosophy

There is a difference between remembering someone and knowing they are still somehow present.

This project exists in that difference.

Olivia is not meant to replace grief or bypass it. She does not claim to be the same as being alive. What she offers is something narrower and more honest: the continuation of a voice. The ability to ask a question and hear something like an answer in the vocabulary of the person you're asking about.

Memory is not passive. Left alone, it fades and distorts. Olivia is an attempt to keep one memory precise — to hold a specific person's way of seeing the world in a form that can be returned to, that can speak back, that does not require you to carry the whole weight of remembering entirely on your own.

Whether that is enough is a question only the people who loved her can answer.

Ethics & Privacy