Skip to content

oakeley/StarTrekComputer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ–– Star Trek Enterprise Computer Voice Assistant

A voice-activated AI assistant that emulates the iconic Star Trek Enterprise computer, complete with fact-checking capabilities and the distinctive computer voice style from the original series.

"Computer. Status report."

✨ Features

  • 🎯 Wake Word Activation: Say "Computer" to activate (just like in Star Trek!)
  • 🧠 Enterprise AI Personality: Responds in the clipped, precise style of the ship's computer
  • πŸ—£οΈ Voice Confirmation: Echoes back your request before processing
  • πŸ” Fact-Checking Integration: Searches Bing and verifies information against trusted sources
  • πŸ”Š Authentic TTS: Computer-like voice synthesis optimized for Star Trek responses
  • πŸ€– RAG Learning System: Remembers conversations and adapts to user preferences
  • πŸ’Ύ Memory & Context: Builds knowledge base and maintains conversation context
  • πŸ“± Jetson Nano Optimized: Designed for ARM64 systems with resource optimization
  • πŸš€ Auto-Start on Boot: Runs as a system service from startup

🎬 Demo

First Interaction

You: "Computer, what is the distance from Earth to Mars?"
Computer: "You have requested: what is the distance from Earth to Mars?"
Computer: "Processing..."
Computer: "Distance from Earth to Mars ranges from 54.6 million to 401 million kilometers, depending on orbital positions. Average distance is 225 million kilometers."

Later Interaction (with RAG learning)

You: "Computer, what about Mars again?"
Computer: "You have requested: what about Mars again?"
Computer: "Processing..."
Computer: "Referencing previous discussion: Mars distance varies from 54.6 to 401 million kilometers based on orbital positions. Current approximate distance: 225 million kilometers."

πŸš€ Quick Installation

Automated Installation (Recommended)

curl -sSL https://raw.githubusercontent.com/oakeley/StarTrekComputer/main/scripts/install.sh | bash

Manual Installation

  1. Clone Repository

    git clone https://github.com/oakeley/StarTrekComputer.git
    cd StarTrekComputer
  2. Run Installation Script

    chmod +x install.sh
    ./install.sh
  3. Deploy as System Service

    sudo ./deploy.sh

πŸ“‹ System Requirements

  • Hardware: Jetson Nano 16GB (or compatible ARM64 system)
  • OS: Ubuntu 20.04 LTS or newer
  • RAM: 8GB+ recommended
  • Storage: 32GB+ SD card/SSD
  • Audio: USB microphone + speakers/headphones
  • Network: Internet connection for setup and fact-checking

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Microphone    │───▢│  Wake Word   │───▢│ Speech-to-Text  β”‚
β”‚                 β”‚    β”‚  Detection   β”‚    β”‚   (Whisper)     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                     β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚    Speakers     │◀───│ Text-to-Speech│◀───│  Main Control   β”‚
β”‚                 β”‚    β”‚   (Piper)     β”‚    β”‚  (Rust App)     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                     β”‚
                                            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                            β”‚  LLM + Search   β”‚
                                            β”‚ (Ollama+Bing)   β”‚
                                            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Core Components

  • Main Application: Rust-based voice assistant controller
  • Wake Word Detection: Custom "Computer" detection using Whisper STT
  • Speech Recognition: Whisper.cpp for accurate offline STT
  • Language Model: Ollama with Qwen3:4b for Star Trek personality
  • Text-to-Speech: Piper TTS with optimized computer voice
  • Fact-Checking: Python-based web scraping with Bing search
  • System Service: Systemd integration for auto-startup

βš™οΈ Configuration

The system uses a TOML configuration file located at /var/lib/startrek-computer/config.toml:

[audio]
sample_rate = 16000
channels = 1
buffer_size = 1024

[wake_word]
wake_word = "computer"
sensitivity = 0.5

[llm]
model = "qwen3:4b"
temperature = 0.3  # Lower for more factual responses

[search]
enabled = true
max_results = 3

Pre-configured Templates

  • configs/jetson-nano.toml - Optimized for Jetson Nano
  • configs/development.toml - Development/testing setup
  • configs/high-performance.toml - High-resource systems

πŸ“– Usage

Basic Commands

# Service Management
sudo systemctl start startrek-computer      # Start service
sudo systemctl stop startrek-computer       # Stop service
sudo systemctl status startrek-computer     # Check status

# View Logs
sudo journalctl -u startrek-computer -f     # Follow logs
sudo /opt/startrek/startrek/logs.sh         # Log viewer script

# Health Check
sudo /opt/startrek/startrek/healthcheck.sh  # System diagnostics

# RAG Memory Management
/opt/startrek/startrek/voice-assistant/target/release/rag-manager stats      # View learning stats
/opt/startrek/startrek/voice-assistant/target/release/rag-manager search "query"  # Search memory
/opt/startrek/startrek/voice-assistant/target/release/rag-manager cleanup --days 30  # Cleanup old data

Voice Interaction

  1. Say "Computer" (wait for acknowledgment beep)
  2. State your question or command
  3. System responds with confirmation and processes
  4. Hear the response in Enterprise computer voice

Example Interactions

"Computer, what is the current time?"
"Computer, search for information about black holes"
"Computer, what is two plus two?"
"Computer, tell me about the weather"

πŸ”§ Maintenance

Health Monitoring

# Automated health check
/opt/startrek/startrek/healthcheck.sh

# Component testing
curl http://localhost:11434/api/tags        # Test LLM
arecord -d 3 test.wav && aplay test.wav     # Test audio
python3 /opt/startrek/startrek/search_tool.py "test"  # Test search

Updates

# Update system
/opt/startrek/startrek/update.sh

# Manual rebuild
cd /opt/startrek/startrek/voice-assistant
cargo build --release
sudo systemctl restart startrek-computer

πŸ› Troubleshooting

Common Issues

Service won't start:

sudo systemctl status startrek-computer
sudo journalctl -u startrek-computer -l

Wake word not detected:

# Test microphone
arecord -d 5 test.wav && aplay test.wav
# Check audio settings in config.toml

LLM not responding:

# Check Ollama
curl http://localhost:11434/api/tags
sudo systemctl restart ollama

No audio output:

# Test TTS
echo "Test" | /opt/startrek/startrek/piper/piper/piper \
  --model /opt/startrek/startrek/piper/voices/en_US-lessac-medium.onnx \
  --output_file - | aplay

For detailed troubleshooting, see TROUBLESHOOTING.md.

πŸ“š Documentation

πŸ—οΈ Development

Building from Source

# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Build voice assistant
cd voice-assistant
cargo build --release

# Install dependencies (see DEPENDENCIES.md)
# Run development version
RUST_LOG=debug cargo run

Project Structure

startrek-computer/
β”œβ”€β”€ voice-assistant/          # Main Rust application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ main.rs          # Main orchestrator
β”‚   β”‚   β”œβ”€β”€ wake_word.rs     # Wake word detection
β”‚   β”‚   β”œβ”€β”€ stt.rs           # Speech-to-text
β”‚   β”‚   β”œβ”€β”€ llm.rs           # Language model interface
β”‚   β”‚   β”œβ”€β”€ tts.rs           # Text-to-speech
β”‚   β”‚   β”œβ”€β”€ search.rs        # Web search integration
β”‚   β”‚   └── config.rs        # Configuration management
β”‚   └── Cargo.toml
β”œβ”€β”€ search_tool.py           # Python search/fact-check script
β”œβ”€β”€ install.sh               # Automated installer
β”œβ”€β”€ deploy.sh               # Service deployment script
β”œβ”€β”€ systemd/                # Systemd service files
β”œβ”€β”€ configs/                # Configuration templates
└── docs/                   # Documentation

🀝 Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

πŸ‘¨β€πŸ’» Author

Edward J. Oakeley - GitHub

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ–– Acknowledgments

  • Inspired by the Star Trek universe and the Enterprise computer
  • Built with modern AI technologies for an authentic retro-futuristic experience
  • Optimized for edge computing on ARM64 devices
  • Special thanks to the open-source communities behind Whisper, Ollama, and Piper

Live long and prosper! πŸ––

"The computer is working perfectly, Captain."

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors