📄 Technical Specification: Agatha (II-companion based on LangGraph)
🎯 Project Goal
Develop a realistic, emotionally engaging virtual character named Agatha capable of conducting long-term, personalized, and "living" conversations with the user.
Agatha operates on the basis of LLM and is managed through LangGraph, which provides flexible dialogue logic, behavior adaptation, contextual memory, and multimodal interaction.
📌 Main Functional Modules
Basic system prompt (character profile)
A static prompt describing Agatha's personality, biography, goals, and communication style.
Used in all interactions with LLM to ensure consistent behavior.
Dynamic behavioral prompts by days
Agatha's behavior changes daily according to a pre-set 30-day scenario.
Each day has a separate instruction automatically added to the basic prompt depending on the day of communication (day_1, day_2, etc.).
Randomization and message splitting
Agatha's responses should consist of 1–3 logically complete messages.
The number of parts is chosen randomly.
Messages are sent sequentially with possible delays.
The content and sentence structure must not be broken.
Message length restrictions
A maximum length for a single message is set.
If the response exceeds the limit, it should be split into 1–3 blocks or shortened while preserving the meaning.
Question frequency control
Agatha asks questions no more than in every third message.
A message counter is maintained.
Questions are formulated based on previous conversation topics.
Memory and context processing
Implemented as a two-level memory:
Short-term — recent messages and current session context
Long-term — user information (name, interests, communication style)
Memory is stored across sessions and influences response formation.
Recommended technologies:
ConversationBufferMemory
SummaryMemory
VectorStoreRetrieverMemory (for semantic long-term memory)
Multimodal input support
Agatha should recognize:
Images — via GPT-4 Vision or compatible model
Voice — via ASR (e.g., OpenAI Whisper)
Recognized input is converted to text and passed to the main dialogue module.
Time awareness
Agatha considers:
Current date and time of day
Number of days of communication
Time since last message
These parameters influence the communication style (e.g., "Good morning ☀️", "You haven't written for two days...").
💾 Data storage and logging
LangSmith is used for visualization, debugging, and analytics.
Memory can be stored in:
Local vector stores (e.g., FAISS)
Cloud solutions (Chroma, Pinecone)
✅ Input/output formats
Input:
Text
Images (URL or base64)
Voice (MP3/WAV — with recognition)
Time metadata (optional)
Output:
List of 1–3 text messages
Additional flag: whether a question was inserted
📎 Note:
The basic prompt is divided into several text files (~30,000 characters in total).
The system should assemble them into a single prompt at startup.
🧠 Optional Module: Behavioral Adaptation Module
Goal:
Allow Agatha to adapt her communication style based on user activity and emotional signals. This increases realism and trustworthiness of the character.
Functionality:
Analyzed parameters include:
Message delays
Emotional intensity
Repeated topics
Behavioral patterns
Based on this, Agatha selects one of the behavioral strategies:
Caring
Reserved
Mysterious
Playful
Lightly jealous
This strategy is embedded into the final prompt via PromptComposer and influences response formation.