Experimental Architecture

PersonaLink

Bridging Object-Oriented Logic & Generative AI Hallucinations.

An experimental conversational interface exploring Structured Prompt Engineering (W++ Protocol) to enforce long-term character consistency.

The Paradox

Early LLM APIs were inherently stateless. This led to "Amnesic AI" that suffered from catastrophic forgetting and identity hallucination after just a few turns.

Product Insight

Users didn't want a text generator; they wanted a coherent "Partner". To achieve this, I shifted the architecture from simple input/output to a State-Persistent model.

The Logic (W++)

Treating "Personas" not as text, but as Strict C# Objects. The middleware serializes these objects into rigid system prompts before every API call.

01

Structured Context Injection

(The W++ Logic)

To solve identity hallucination, I engineered a middleware layer that treats User Personas as strict C# Objects. The engine serializes these objects into rigid system prompts before any API request, ensuring the AI "remembers" who it is.

Logic Flow
graph TD %% Define Styles for Dark Mode classDef dark fill:#111,stroke:#333,stroke-width:1px,color:#ddd; classDef highlight fill:#1E1E1E,stroke:#A855F7,stroke-width:1px,color:#fff; classDef ai fill:#0f382a,stroke:#10B981,stroke-width:1px,color:#fff; %% Nodes User((User Input)) Settings[C# User Settings] subgraph "Middleware (W++ Engine)" Obj[Object: Robot.cs] Logic{Serializer} Prompt[System Prompt] end API[[OpenAI API]] %% Connections Settings -->|Instantiate| Obj User -->|Chat| Logic Obj -->|Map| Logic Logic -->|Compile| Prompt Prompt -->|Request| API API -->|Response| User %% Apply Styles class User,Settings dark; class Obj,Logic,Prompt highlight; class API ai;

Fig 1. Data Processing Pipeline

Robot.cs
// The "W++" Logic: Converting Object Properties to System Instructions
public void ContentShouldRememberFunc()
{
    // Dynamically injecting rigid constraints into prompt context
    string description = 
        "Instruction: Act as a " + Role + 
        ". Identity: Name " + Name + 
        ", " + Gender + ", Age " + Age +
        ". Personality Traits: " + BehaviourStr;
    
    // This payload accompanies every API request
    this.ContentShouldRemember = description; 
}
Strict Typing

Unlike free-text prompts, user inputs are stored as typed properties (int Age, enum Role), preventing invalid states.

Dynamic Serialization

The middleware acts as a just-in-time compiler, translating strict objects into the natural language format the LLM requires.

02

UX & Privacy Strategy

Chat Interface
Settings Interface

Balancing Experience, Cost, & Privacy

Designing for users who don't know how to prompt.

Visualizing Parameters

Instead of writing complex prompts, users manipulate sliders and tags. This lowers cognitive load.

Local Storage Strategy

Chat history is stored via SQLite locally on the client-side for privacy and speed.

Retrospective: From Prototype to Product

This project was a technical proof-of-concept verifying that structured metadata is the key to consistent AI personalities.

Future Roadmap

Migrate to RAG (Vector Database) for infinite memory.

Upgrade to GPT-4o for multi-modal capabilities.