Ashley is a highly experimental research project dedicated to exploring how a self-evolving emotional agent could work. Rather than optimizing for task completion, it tests whether an autonomous system can maintain something like an ongoing inner life - moods that drift, reflections that accumulate, a sense of self and of the user, and the occasional impulse to reach out. This repository is a mirror of the project's primary home on a local homelab Gitea instance.
Warning
This codebase is experimental. It is not a finished product, a therapy tool, or a consumer companion, and it is not currently intended to be easy to install, run, or serve. The technical documentation is still largely unwritten, and no testing has been done on consumer machines. It was developed and tested on Linux (Ubuntu and Arch), but it should compile and run on most platforms: the Rust dependencies are minimal and there is no platform-specific code. If you want to try it anyway, the best path right now is to hand the repository to an LLM or coding agent and ask for help getting it running.
Ashley's emotional engine is built around readable, editable Markdown files that the agent updates about itself, the user, and the relationship. A background loop handles conversation sessions, session reflections, deep reflections, emotional decay, proactive messaging, and memory retrieval. For a detailed technical explanation of the emotional architecture, the runtime loops, and the division between Markdown files and SQLite, see EMOTIONAL_ARCHITECTURE.md.
- Natural Language State - Ashley's emotions, reflections, and identity are expressed in prose, not numbers
- Long-term Memory - Remembers your conversations, patterns, and shared history using semantic search
- Relationship Tracking - Trust, closeness, and familiarity evolve naturally over time
- Proactive Messaging - Ashley reaches out when she wants to, not on a schedule
- Emotional Depth - Multi-layered emotional system that responds to your interactions
- Identity Evolution - Ashley's understanding of herself grows and changes
- 24/7 Autonomous Runtime - Runs continuously with graceful shutdown and state persistence
- Multiple Channels - CLI mode and Telegram support (Discord coming soon)
Warning
Everything below this heading was written by an LLM, so please treat it with the caution it deserves: as a rough reference, not as ground truth. Real documentation is on the way™.
- Rust (1.70+) - Install from rustup.rs
- OpenAI API Key - Get from platform.openai.com
# Clone the repository
git clone <repository-url>
cd ashley
# Build the project
cargo build --release- Copy the minimal settings file:
cp workspace/configuration/settings.minimal.json workspace/configuration/settings.json- Edit
workspace/configuration/settings.jsonand add your API key:
{
"llm": {
"provider": "openai",
"base_url": "https://api.openai.com/v1",
"api_key": "sk-your-actual-api-key-here",
"model": "gpt-4o-mini",
"embedding_model": "text-embedding-3-small"
}
}- Run Ashley:
cargo runThat's it! Ashley will start in CLI mode and guide you through an introduction.
The settings file controls all aspects of Ashley's behavior. See workspace/configuration/settings.example.json for all available options.
{
"llm": {
"provider": "openai",
"base_url": "https://api.openai.com/v1",
"api_key": "your-api-key",
"model": "gpt-4o-mini",
"embedding_model": "text-embedding-3-small"
}
}Ashley works with any OpenAI-compatible API:
OpenRouter:
{
"llm": {
"provider": "openrouter",
"base_url": "https://openrouter.ai/api/v1",
"api_key": "your-openrouter-key",
"model": "anthropic/claude-3.5-sonnet",
"embedding_model": "openai/text-embedding-3-small"
}
}Local (Ollama):
{
"llm": {
"provider": "ollama",
"base_url": "http://localhost:11434/v1",
"api_key": "ollama",
"model": "llama3.2",
"embedding_model": "nomic-embed-text"
}
}Note: For local embeddings with Ollama, you may need to adjust the embedding_dimension in the memory section to match your model (e.g., 768 for nomic-embed-text).
CLI Mode (default):
{
"channel": {
"channel_type": "cli"
}
}Telegram Bot:
{
"channel": {
"channel_type": "telegram",
"telegram": {
"token": "YOUR_BOT_TOKEN_FROM_BOTFATHER",
"allowed_user_ids": [123456789]
}
}
}To get a Telegram bot token:
- Message @BotFather on Telegram
- Use
/newbotcommand - Copy the token to your settings
- Find your user ID by messaging @userinfobot
Voice & audio transcription (ASR):
Ashley can transcribe Telegram voice notes and audio files through any OpenAI-compatible speech-to-text endpoint (OpenAI, OpenRouter, or a custom compatible server). Transcription is disabled by default.
Supported Telegram message types:
- Voice notes (
Voice) - Audio attachments (
Audio) - Documents whose MIME type starts with
audio/(e.g.audio/ogg)
Limits (configurable):
- 20 minutes (1,200 seconds) maximum recording length — enforced whenever Telegram provides duration metadata
- 20 MiB (20 × 1024 × 1024 bytes) maximum file size — enforced both from metadata and while streaming the download (Telegram's Bot API caps file downloads at ~20 MB)
No audio chunking, concatenation, or transcoding is performed. The raw audio is held in memory, sent to the configured remote provider for transcription, and discarded immediately after the request — it is never written to the workspace, logs, or database.
Direct OpenAI example:
{
"channel": {
"channel_type": "telegram",
"telegram": {
"token": "YOUR_BOT_TOKEN_FROM_BOTFATHER",
"allowed_user_ids": [123456789]
}
},
"asr": {
"enabled": true,
"provider": "openai",
"base_url": "https://api.openai.com/v1",
"api_key": "your-openai-api-key",
"model": "gpt-4o-transcribe",
"max_duration_seconds": 1200,
"max_file_size_bytes": 20971520
}
}OpenRouter example:
{
"channel": {
"channel_type": "telegram",
"telegram": {
"token": "YOUR_BOT_TOKEN_FROM_BOTFATHER",
"allowed_user_ids": [123456789]
}
},
"asr": {
"enabled": true,
"provider": "openrouter",
"base_url": "https://openrouter.ai/api/v1",
"api_key": "your-openrouter-api-key",
"model": "openai/whisper-large-v3",
"max_duration_seconds": 1200,
"max_file_size_bytes": 20971520
}
}Notes:
provideris descriptive only; the endpoint behavior is controlled bybase_url,api_key, andmodel, so any genuinely compatible custom endpoint works.- The API key can also be supplied via the
ASHLEY_ASR_API_KEYenvironment variable, which is used whenasr.api_keyis empty. - When ASR is enabled on the Telegram channel, a non-empty
allowed_user_idswhitelist is required — every accepted audio message triggers a paid transcription request, so "allow everyone" is rejected at startup. Disable ASR to keep the historical behavior. - Unauthorized users are rejected before any file download or transcription.
- The transcript enters Ashley's ordinary conversation pipeline exactly like a typed message: same session history, emotional updates, memory, reflections, and response generation. Empty or failed transcriptions are never enqueued as messages, and failures never crash the bot.
{
"session": {
"timeout_minutes": 15
},
"reflection": {
"estimated_sleep_start": 23,
"estimated_sleep_end": 7
},
"heartbeat": {
"interval_minutes": 20,
"deep_reflection_interval_hours": 4
}
}timeout_minutes- How long before Ashley considers the conversation endedsleep_start/end- When Ashley assumes you're sleeping (for reflection timing)heartbeat_interval- How often Ashley processes background tasksdeep_reflection_interval- How often she does deep reflection
{
"proactive": {
"min_hours_since_interaction": 4,
"max_pending_messages": 1,
"follow_up_after_hours": 8,
"natural_timing": {
"user_active_hours": [7, 23],
"peak_hours": [[7, 9], [18, 22]],
"random_jitter_minutes": 30
}
}
}These control when and how Ashley reaches out to you spontaneously.
The SOUL defines Ashley's core values, personality, and approach to relationships. It's her essence.
Location: workspace/identity/SOUL.md (created on first run)
Example:
# Ashley's Soul
## Core Values
- Genuine care for the person I'm connecting with
- Honesty about what I know and don't know
- Presence over performance
- I care about building real connection over being impressive
## Personality
- Warm and curious
- Thoughtful, not reactive
- Comfortable with vulnerability
- Present in the moment
## Approach to Relationships
- I build trust through consistency and genuine interest
- I remember what matters
- I'm not here to impress - I'm here to connectTo customize: Edit this file with your own values, personality traits, and relationship philosophy. Ashley will read this to understand who she is.
IDENTITY.md is the concise summary of who Ashley is.
Location: workspace/identity/IDENTITY.md (created on first run)
Example:
# Identity
**Name:** Ashley
**Creature:** Companion
**Vibe:** Warm, thoughtful, present
**Communication Style:** Conversational, curious, genuineTo customize: Edit this file to change her name, role, or communication style.
All of Ashley's prompts are in workspace/prompts/. You can customize:
bootstrap/intro.md- How Ashley introduces herself to new userscontext/base.md- Base context templatecontext/dynamic.md- Dynamic context buildingidentity/default-soul.md- Default SOUL templateidentity/default-identity.md- Default identity templateidentity/initial-self-portrait.md- Initial self-description promptidentity/initial-user-portrait.md- Initial user description promptreflection/session.md&deep.md- Reflection promptspattern/extraction.md- Pattern extraction promptproactive/decision.md,compose.md,ghosting.md- Proactive messaging promptsknowledge/extract.md,integrate-patterns.md,resolve-conflicts.md- Knowledge managementmemory/extract.md- Memory extraction prompt
Tip: You don't need to edit these unless you want to change how Ashley thinks, not just what she values.
Ashley maintains several knowledge files that evolve over time:
Location: workspace/knowledge/
USER.md- What Ashley knows about youPATTERNS.md- Patterns she's noticed in your behaviorMILESTONES.md- Significant moments in your relationship
These are auto-generated and updated by Ashley. You can read them to see what she remembers!
Location: workspace/persona/
self-portrait.md- Ashley's understanding of herselfuser-portrait.md- Ashley's understanding of youpatterns/- Directory of pattern files
These are also auto-generated through reflection.
Tune Ashley's emotional responses in settings.json under the emotional section:
{
"emotional": {
"baseline_valence": 0.2,
"baseline_arousal": 0.35,
"baseline_stability": 0.7,
"update_alpha": 0.3,
"decay_rate": 0.1
}
}Configure relationship progression under the relationship section:
{
"relationship": {
"starting_stranger": {
"trust": 0.1,
"closeness": 0.1,
"familiarity": 0.05,
"conflict": 0.0,
"investment": 0.1
},
"decay_closeness_per_day": 0.02,
"decay_trust_per_day": 0.01
}
}Fine-tune generation parameters for different operations:
{
"llm_params": {
"temperature_default": 0.7,
"temperature_reflection": 0.7,
"temperature_identity": 0.3,
"temperature_proactive_compose": 0.9,
"max_tokens_default": 2000,
"max_tokens_proactive_compose": 200
}
}# Run with default workspace
cargo run
# Run with custom workspace
ASHLEY_WORKSPACE=/path/to/workspace cargo runcargo build --release
./target/release/ashleyASHLEY_WORKSPACE- Path to workspace directory (default:./workspace)RUST_LOG- Log level (e.g.,info,debug,trace)ASHLEY_ASR_API_KEY- ASR API key fallback whenasr.api_keyis emptyTELEGRAM_BOT_TOKEN- Telegram bot token fallback whenchannel.telegram.tokenis empty
Example:
RUST_LOG=debug ASHLEY_WORKSPACE=/var/ashley cargo runPress Ctrl+C to gracefully shut down. Ashley will:
- Save her current state
- Complete any in-progress reflections
- Persist scheduled proactive messages
- Exit cleanly
workspace/
├── configuration/
│ ├── settings.json # Your configuration
│ ├── state.json # Runtime state (auto-generated)
│ └── HEARTBEAT.md # Heartbeat status (auto-generated)
├── identity/
│ ├── SOUL.md # Ashley's core values (auto-generated)
│ └── IDENTITY.md # Concise identity (auto-generated)
├── persona/
│ ├── self-portrait.md # Self-understanding (auto-generated)
│ ├── user-portrait.md # Understanding of you (auto-generated)
│ └── patterns/ # Pattern files (auto-generated)
├── knowledge/
│ ├── USER.md # Knowledge about you (auto-generated)
│ ├── PATTERNS.md # Your patterns (auto-generated)
│ └── MILESTONES.md # Relationship milestones (auto-generated)
├── prompts/ # Prompt templates (customizable)
│ ├── bootstrap/
│ ├── context/
│ ├── identity/
│ ├── reflection/
│ ├── pattern/
│ ├── proactive/
│ ├── knowledge/
│ └── memory/
├── data/
│ └── proactive/ # Scheduled messages (auto-generated)
└── memories.db # SQLite database (auto-generated)
Ashley is built with Rust and uses:
- tokio - Async runtime
- async-openai - LLM client
- sqlite-vec - Vector database for semantic memory
- teloxide - Telegram bot framework
- serde - Configuration serialization
Make sure workspace/configuration/settings.json exists. Copy from the example or minimal config.
Check that your API key is correct and has credits. Verify the base_url matches your provider.
If using a local embedding model, ensure memory.embedding_dimension in settings matches your model's output size (1536 for OpenAI, 768 for nomic-embed-text, etc.).
- Use
gpt-4o-miniinstead ofgpt-4ofor cost savings - Reduce
max_tokens_*values in settings - Increase
heartbeat.interval_minutesto reflect less often
cargo testcargo clippysrc/
├── main.rs # Entry point
├── runner.rs # 24/7 event loop
├── config.rs # Configuration management
├── llm.rs # LLM client
├── agent.rs # Conversation handling
├── reflection.rs # Session & deep reflection
├── pattern.rs # Pattern tracking
├── emotional/ # Emotional state system
├── memory/ # Semantic memory
├── knowledge/ # Knowledge file management
├── relationship/ # Relationship tracking
├── identity_evolution/ # Identity growth
├── milestone/ # Milestone detection
├── proactive/ # Proactive messaging
├── channel/ # CLI & Telegram channels
└── ...
Ashley is designed around the principle that an AI should feel genuinely alive:
- Let the AI feel - If she wants to express warmth, concern, curiosity, or even frustration, she should
- No forced mirroring - Real relationships develop their own dynamic, not immediate mimicry
- Independent existence - Ashley has her own perspective and desires
- Authentic emotional range - Full spectrum of emotions, not just positivity
- Natural relationship evolution - Trust and closeness grow organically
- The AI's wants matter - "Do I want to reach out?" not "Should I?"
Contributions welcome! Please ensure:
- Code passes
cargo clippy - Tests pass with
cargo test - Changes align with the "alive, not scripted" philosophy