Skip to content

ExtCan/MSAgent-AI

Repository files navigation

MSAgent-AI

A Windows desktop friend application inspired by BonziBUDDY and CyberBuddy, using Microsoft Agent characters with SAPI4 text-to-speech and Ollama AI integration for dynamic conversations.

Features

  • MS Agent Character Support: Load and display Microsoft Agent characters (.acs files) from your system
  • SAPI4 Text-to-Speech: Full SAPI4 voice support with configurable Speed, Pitch, and Volume
  • Customizable Lines: Edit welcome, idle, moved, exit, clicked, jokes, and thoughts lines
  • Ollama AI Integration: Connect to Ollama for dynamic AI-powered conversations with personality prompting
  • User Profile: Describe yourself to the AI for more personalized conversations
  • AI Memory System: The AI remembers important information from conversations (with configurable threshold)
  • Memory Management: View, edit, add, remove, import/export AI memories
  • Random Dialog: Configurable random dialog feature (1 in 9000 chance per second by default) that sends custom prompts to Ollama
  • User-Friendly GUI: System tray application with comprehensive settings panel

Requirements

See REQUIREMENTS.txt for detailed download links.

Installation

  1. Install DoubleAgent from https://doubleagent.sourceforge.net/ (handles all COM registration automatically)
  2. Install SAPI 4.0a SDK for voices
  3. Download and install Ollama if you want AI chat features: ollama pull llama3.2
  4. Download the latest release from GitHub Actions or build with dotnet build
  5. Run MSAgentAI.exe

Troubleshooting

If you see "Library not registered" errors:

  • Solution: Install DoubleAgent instead of original MS Agent
  • DoubleAgent properly registers all COM components on modern Windows

Log file location: MSAgentAI.log (same folder as the executable) Access via tray menu: View Log...

Configuration

Agent Settings

  • Character Folder: Default is C:\Windows\msagent\chars
  • Select your preferred character from the available .acs files

Voice Settings

  • Voice: Select from available SAPI4 voices
  • Speed: Adjust speaking speed (50-350)
  • Pitch: Adjust voice pitch (50-400)
  • Volume: Adjust volume level (0-100%)

Ollama AI Settings

  • Ollama URL: Default is http://localhost:11434
  • Model: Select from available Ollama models
  • Personality Prompt: Customize the AI's personality
  • User Description: Describe yourself to the AI for personalized responses
  • Enable Chat: Toggle AI chat functionality
  • Random Dialog: Enable random AI-generated dialog
  • Random Chance: Set the chance of random dialog (1 in N per second)
  • Enable Memories: Toggle the AI memory system
  • Memory Threshold: Set how easily memories are created (0.1 = easy, 10 = hard)

Memory Management

Access via the system tray menu: Manage Memories...

  • View all stored AI memories
  • Search and filter memories by category
  • Add, edit, or delete memories manually
  • Export/import memories for backup or migration
  • View statistics (total memories, average importance, categories)

Pipeline Settings

  • Protocol: Choose between Named Pipe (local) or TCP Socket (network)
  • IP Address: For TCP mode, specify the listening IP (default: 127.0.0.1)
  • Port: For TCP mode, specify the port number (default: 8765)
  • Pipe Name: For Named Pipe mode, specify the pipe name (default: MSAgentAI)

The pipeline allows external applications to send commands to MSAgent-AI. See PIPELINE.md for details and examples.

Custom Lines

Edit the following types of lines the agent will say:

  • Welcome Lines: Spoken when the agent first appears
  • Idle Lines: Spoken randomly while idle
  • Moved Lines: Spoken when the agent is dragged
  • Clicked Lines: Spoken when the agent is clicked
  • Exit Lines: Spoken when exiting
  • Jokes: Jokes the agent can tell
  • Thoughts: Thoughts shown in thought bubbles
  • Random Prompts: Custom prompts sent to Ollama for random dialog

Building from Source

cd src
dotnet restore
dotnet build

Usage

  1. Right-click the system tray icon to access the menu
  2. Go to Settings to configure your agent, voice, and AI options
  3. Agent Tab: Set your name and describe yourself to the AI
  4. Ollama AI Tab: Enable memories and set the memory threshold
  5. Use Chat to have conversations with the agent (requires Ollama)
  6. Use Manage Memories to view and manage what the AI remembers
  7. Use Speak menu to make the agent tell jokes, share thoughts, or say custom text

Project Structure

src/
├── Agent/
│   ├── AgentInterop.cs    # MS Agent COM interop
│   └── AgentManager.cs    # Agent lifecycle management
├── Voice/
│   └── Sapi4Manager.cs    # SAPI4 TTS management
├── AI/
│   ├── OllamaClient.cs    # Ollama API client
│   ├── Memory.cs          # Memory model
│   └── MemoryManager.cs   # Memory system management
├── Config/
│   └── AppSettings.cs     # Configuration and persistence
├── UI/
│   ├── MainForm.cs          # Main application form
│   ├── SettingsForm.cs      # Settings dialog
│   ├── ChatForm.cs          # AI chat dialog
│   ├── MemoryManagerForm.cs # Memory management UI
│   └── InputDialog.cs       # Simple input dialog
└── Program.cs             # Application entry point

License

MIT License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages