Neocortex Session Manager
Reference for the Neocortex Session Manager in Unity, which stores session IDs per character in PlayerPrefs so conversations persist across game sessions.
The NeocortexSessionManager is a static class that provides methods to manage chat session IDs for characters. Session IDs are stored locally using PlayerPrefs, allowing for persistent conversations across game sessions.
Methods
SetSessionID
Sets a session ID for a specific character.
- Parameters:
- characterID: The unique identifier for the character.
- sessionId: The session ID to store.
using Neocortex;
// Store a session ID for a character
NeocortexSessionManager.SetSessionID("char_123", "session_abc");GetSessionID
Retrieves the stored session ID for a specific character.
- Parameters:
- characterID: The unique identifier for the character.
- Returns: The session ID string, or an empty string if no session ID is found.
using Neocortex;
// Retrieve the session ID for a character
string sessionId = NeocortexSessionManager.GetSessionID("char_123");
if (!string.IsNullOrEmpty(sessionId))
{
Debug.Log($"Current Session ID: {sessionId}");
}CleanSessionID
Clears the stored session ID for a specific character, effectively starting a new conversation history for that character.
- Parameters:
- characterID: The unique identifier for the character.
using Neocortex;
// Clear the session ID to start a new chat history
NeocortexSessionManager.CleanSessionID("char_123");Neocortex Group Director
Reference for the Neocortex Group Director in Unity, which lets several AI characters share one conversation, picks who speaks next and runs ambient turns.
Neocortex Event Logger
Reference for the Neocortex Event Logger in Unity, which pushes world events into a buffer so your AI characters know what happened outside the conversation.