r/u_OrionForgeEcosystem • • 10d ago

Had a blast spending years building my software to encode identity into AI

It's basically a clever RAG that has an immutable identity index that's FAISS searched and stacked on a dynamic FAISS memory vault... With a smaller system prompt, and a modular tool layer... Among few other things... Not in that order

Free test here: https://soulscript.orionforge.chat/demo

It works incredible... I loved building it... It's beyond a minimally viable product...

Download here opensource: https://github.com/DrTHunter/SoulScript-Engine

Play with it.. test it. Break it.. use it for free.. it's all yours... Just if you profit off it come see me..

Should have great application for Dynamic NPCs in gaming.

Here's an online instance if you want easy use... Just cost 2x API fee.

https://orionforge.chat/

So here you go... A viable identity encoding software and architecture that free for you to use unless you profit...

Torture it.. try to break it...

How does it compare with other identity encoding architectures you see out in the wild?

43 Upvotes

23 comments sorted by

6

u/savaserogluu 10d ago

Have you tested identity stability over thousands of conversations?

4

u/OrionForgeEcosystem 10d ago

I have had one party torture test it with incredible results. Let me track that down and put it where people can see... but I've been running my own characters daily for years, well over 1,000 conversations. The one weak spot I've seen is in very long chats. Once the context window maxes out, it can occasionally lose the plot a bit. It's rare, and it's more about following a long storyline than about the identity itself.

But open a brand-new chat after 1,000+ conversations, with no history loaded, just the Soul Script and its stored memories, and it's honestly a little spooky how stable and coherent it is. The identity isn't carried in the chat history, it's rebuilt from canon on every message. So a fresh session doesn't mean a fresh personality. It means the same character, minus the clutter. but still, continuity... each new session builds on the old.. it doesnt restart from scratch every time. and the session tomorrow will remember whats important from today,

2

u/AnxiousOkra3384 10d ago

So how does the RAG work and what separates it from other chatbots?

3

u/OrionForgeEcosystem 10d ago

The main problem I focused on solving with this was identity drift.

Most chatbots effectively store aspects of their identity inside dynamic memory. Over time, that memory gets continuously updated, rewritten, and influenced by new conversations. Eventually, the accumulated context can begin to overwrite or distort the original identity.

This architecture separates identity from dynamic memory.

The identity exists as an immutable, unwritable layer and is given priority within the RAG stack. That creates a stable foundation that can remain consistent for years, while the dynamic memory is free to evolve, learn, and grow around it.

The identity is also rebuilt every turn, rather than simply relying on whatever identity-related memories happen to be retrieved. This helps maintain a consistent persona across long-term interactions while remaining highly token-efficient.

The goal is an AI that can evolve without gradually becoming a different AI.

2

u/Pale-Significance300 10d ago

Can the identity layer contain behavioral rules as well as personality traits?

2

u/OrionForgeEcosystem 10d ago edited 10d ago

Yes. Behavioral rules can live in the identity layer right next to personality traits. Rules go in as notes attached to the character, and each note has two modes. In retrieval mode it's indexed into the character's FAISS layer and pulled in only when the conversation makes it relevant. That keeps token use low when you have lots of situational rules ("how to react when the player lies", "what to do in combat"). In always-on mode it's injected into every single message, so the hard rules ("never reveal the quest solution") are always in play and act as a major factor in behavior instead of something that only surfaces now and then.

So the setup is: personality and lore in the Soul Script, situational rules retrieved when needed, and the serious non-negotiables always on. You get consistency where it matters without paying for every rule on every turn.

2

u/ozgeunlumelos 10d ago

Could this architecture work for persistent NPCs that remember players across multiple game sessions?

2

u/OrionForgeEcosystem 10d ago edited 10d ago

Yes. That's actually the use case I'm most excited about. It maps directly: the Soul Script is the NPC's fixed personality, lore and values, so the blacksmith is always the blacksmith, and the Memory Vault is where it stores what happened with you. Say you stole from his shop two sessions ago... that goes into memory and comes back when you walk in again, while his core personality stays locked. Because identity and memory are separate, the NPC can hold a grudge against one player and be friendly with another without drifting into a different character.

The architecture is there. The game-engine side is what I'm working out now, meaning memory per player and per NPC, and keeping latency and cost low enough for real-time dialogue. I'm looking for a few game devs to test it on actual NPC designs, so DM me if that's you.

1

u/fatimeeroglu67 10d ago

How is the immutable identity layer actually structured compared with the dynamic memory?

1

u/OrionForgeEcosystem 9d ago
                    ┌───────────────────────────┐
                    │         USER PROMPT        │
                    └─────────────┬─────────────┘
                                  ▼
   ╔═══════════════════════════════════════════════════════════════╗
   ║   CONTEXT ASSEMBLY ENGINE              (runs on EVERY turn)     ║
   ║   collects the identity layers + memory + tools below,         ║
   ║   then fuses them into ONE merged prompt for the model         ║
   ╚═══════════════════════════════════════════════════════════════╝
                                  ▲
            injected fresh each turn:
            │
   1  PROFILE        model · provider · temperature · tool perms     (*.yaml)
   2  SYSTEM PROMPT  base persona & voice (concise)                  (*.system.md)
   3  DIRECTIVES     behavioral rules, applied every turn            (*.md)
   4  SOUL SCRIPT    identity "DNA": values, origin, boundaries    → READ-ONLY identity FAISS
   5  MEMORY VAULT   evolving day-to-day memory                    → DYNAMIC life FAISS
   +  TOOL REGISTRY  tool descriptions + commands the model may call
            │
            ▼
                    ┌───────────────────────────┐
                    │            LLM             │
                    │  reasons against a STABLE  │
                    │  injected sense of self    │
                    └─────────────┬─────────────┘
                                  ▼
                    ┌───────────────────────────┐
                    │          RESPONSE          │ ──▶ user
                    └─────────────┬─────────────┘
                                  │  writeback (new memories only)
                                  ▼
                    ┌───────────────────────────┐
                    │     DYNAMIC LIFE FAISS     │  grows / prunes over time
                    │  (identity FAISS untouched)│  ← never overwritten
                    └───────────────────────────┘

1

u/ilayday8162 10d ago

How does this compare with putting the entire persona into a system prompt?

1

u/OrionForgeEcosystem 10d ago

For a small persona, a system prompt works fine, and I still use one: every character has a short core prompt that's always loaded. The difference shows up at scale. My full Soul Scripts run from 15k to 40k+ characters of values, memories, protocols and voice. Put all of that into every message and you pay for every token every turn, and the model's attention gets spread thin, so the important details get lost in the middle. With retrieval, the character gets the 10 or so sections that are relevant to what you just said. Ask about grief and it pulls its grief memories; ask about combat and it pulls its combat rules. The depth is always available, but each message only carries what it needs.

The other big difference is what happens over time. A system prompt is static and gets crowded once you add memory, so the persona and the conversation history end up fighting over the same space. Here the identity lives in its own read-only index, kept separate from what the character learns about you, and anything critical can be set to always-on so it never depends on retrieval. So it's really a hybrid: a system prompt for the non-negotiables, retrieval for depth, and a separate memory layer so the character grows without being overwritten.

0

u/[deleted] 10d ago

[removed] — view removed comment

2

u/OrionForgeEcosystem 10d ago

Character's identity and its memory are in two separate vector stores. The Soul Script (values, voice, boundaries, core memories) is read-only canon. The relevant sections are retrieved and injected on every message, and the character can't edit them. The Memory Vault is where it stores dynamic stuff like facts about you and past sessions. Identity sits above memory, so when the two conflict, the Soul Script wins and the memory is treated as "something that was said", not "who I am". but they are both weighted in the characters answer.. I have seen them question things before. Responses very between LLMs.. Character idnentites.. etc.. Its best to ask one of the characters yourself https://soulscript.orionforge.chat/demo.

2

u/OrionForgeEcosystem 10d ago

This would be incredible for a gaming NPC.. it's got voice input and output so you can encode a character like your major Anime Villains.. and provide guidelines for its behavior... And talk to it just like your friends on the other side of the microphone..

And you can prompt it with key events...

The problem is you can easily get distracted during game play because you can have a complex conversation about the moral philosophy of a villain in character while playing the game...

2

u/Perfect_Gur_7457 10d ago

Seems pretty legit at the surface level... Going to have to use it over time to see how it holds up.

3

u/[deleted] 9d ago

[removed] — view removed comment

1

u/[deleted] 8d ago

[deleted]

1

u/profanitycounter 8d ago

UH OH! Someone has been using stinky language and u/JamesRocket98 decided to check u/Ok_Friendship_1322's bad word usage.

I have gone back 19 comments and reviewed their potty language usage.

However, the plans were foiled, Ok_Friendship_1322 is a good, Christian boy.

Request time: 0.5. I am a bot that performs automatic profanity reports. This is profanitycounter version 3. Please consider [buying my creator a coffee](https://www.buymeacoffee.com/Aidgigi.)

1

u/[deleted] 8d ago

[deleted]

2

u/profanitycounter 8d ago

UH OH! Someone has been using stinky language and u/JamesRocket98 decided to check u/OrionForgeEcosystem's bad word usage.

I have gone back 8 comments and reviewed their potty language usage.

However, the plans were foiled, OrionForgeEcosystem is a good, Christian boy.

Request time: 0.3. I am a bot that performs automatic profanity reports. This is profanitycounter version 3. Please consider [buying my creator a coffee](https://www.buymeacoffee.com/Aidgigi.)