/mycroft-core

Mycroft Core, the Mycroft Artificial Intelligence platform.

Primary LanguagePythonApache License 2.0Apache-2.0

License Unit Tests codecov PRs Welcome Chat GitHub Discussions

OVOS-core

OpenVoiceOS is an open source platform for smart speakers and other voice-centric devices.

Mycroft is a hackable, open source voice assistant by MycroftAI. OVOS-core is a backwards-compatible descendant of Mycroft-core, the central component of Mycroft. It contains extensions and features not present upstream. All Mycroft Skills and Plugins should work normally with OVOS-core. Other Mycroft-based assistants are also believed, but not guaranteed, to be compatible.

The biggest difference between OVOS-core and Mycroft-core is that OVOS-core is fully modular. Furthermore, common components have been repackaged as plugins. That means it isn't just a great assistant on its own, but also a pretty small library!

Furthermore, it offers a number of cli bindings. The old Mycroft shell scripts still exist, and still work, but that stuff is now built into the Python program (docs to follow in the form of --help, because it's a lot.)


Installing OVOS-core (NOTE: at this early stage, required system libs are presumed, and your distribution might be a question mark.)

We suggest you do this in a virtualenv:

pip install ovos-core[all]


As always, the OpenVoiceOS team thanks the following entities (in addition to MycroftAI) for making certain code and/or manpower resources available to us which may not have been compatible with our practices before:

  • NeonGecko
  • HelloChatterbox
  • KDE
  • Blue Systems

Table of Contents

Running Mycroft

start-mycroft.sh is available to perform common tasks.

Note: MycroftAI's dev_setup.sh does not exist in OVOS-core.

Assuming you installed mycroft-core in your home directory, run:

  • cd ~/ovos-core
  • ./start-mycroft.sh debug

The "debug" command will start the background services (microphone listener, skill, messagebus, and audio subsystems) as well as bringing up a text-based Command Line Interface (CLI) you can use to interact with Mycroft and see the contents of the various logs. Alternatively you can run ./start-mycroft.sh all to begin the services without the command line interface. Later you can bring up the CLI using ./start-mycroft.sh cli.

The background services can be stopped as a group with:

  • ./stop-mycroft.sh

Using Mycroft

Skills

Mycroft is nothing without skills. There are a handful of default skills, but most need to be installed explicitly.
See the Skill Repo to discover skills made by others.
Please share your own interesting work!

Behind the scenes

Identity Information

A unique uuid and pairing information generated by registering with Home is stored in: ~/.config/mycroft/identity/identity2.json <-- DO NOT SHARE THIS WITH OTHERS!

This file uniquely identifies your device and should be kept safe

Configuration

Mycroft's configuration consists of 4 possible locations:

  • mycroft-core/mycroft/configuration/mycroft.conf(Defaults)
  • Mycroft Home (Remote)
  • /etc/mycroft/mycroft.conf (Machine)
  • $XDG_CONFIG_DIR/mycroft/mycroft.conf (which is by default $HOME/.config/mycroft/mycroft.conf) (USER)

When the configuration loader starts, it looks in these locations in this order, and loads ALL configurations. Keys that exist in multiple configuration files will be overridden by the last file to contain the value. This process results in a minimal amount being written for a specific device and user, without modifying default distribution files.

Remote configuration only exists if you explicitly enabled a backend

Home Device and Account Manager

Mycroft AI, Inc. maintains a device and account management system known as Mycroft Home. Developers may sign up at: https://home.mycroft.ai

By default, mycroft-core is configured to not use Home.

When enabled by saying "Hey Mycroft, pair my device" (or any other request verbal request) you will be informed that your device needs to be paired. Mycroft will speak a 6-digit code which you can enter into the pairing page within the Mycroft Home site.

The Mycroft backend provides access to a range of third-party APIs for specific services. Once paired, your unit can use Mycroft API keys for services such as Speech-to-Text (STT), weather and various other skills. Without pairing with the Mycroft backend, you may need to add your own API keys, install a different Skill or Plugin to perform that function, or not have access to that functionality.

For default OpenVoiceOS skills free proxies/services are used that do not require pairing

Using Mycroft with a backend

If you wish to use the Mycroft Home service, before starting Mycroft for the first time, create $HOME/.config/mycroft/mycroft.conf with the following contents:

"server": {
  "disabled": false,
  "url": "https://api.mycroft.ai",
  "version": "v1",
  "update": false,
  "metrics": false,
  "sync_skill_settings": true
}

You can also use OpenVoiceOS/OVOS-local-backend or self host selene

Using Mycroft behind a proxy

Many schools, universities and workplaces run a proxy on their network. If you need to type in a username and password to access the external internet, then you are likely behind a proxy.

If you plan to use Mycroft behind a proxy, then you will need to do an additional configuration step.

NOTE: In order to complete this step, you will need to know the hostname and port for the proxy server. Your network administrator will be able to provide these details. Your network administrator may want information on what type of traffic Mycroft will be using. We use https traffic on port 443, primarily for accessing ReST-based APIs.

Using Mycroft behind a proxy without authentication

If you are using Mycroft behind a proxy without authentication, add the following environment variables, changing the proxy_hostname.com and proxy_port for the values for your network. These commands are executed from the Linux command line interface (CLI).

$ export http_proxy=http://proxy_hostname.com:proxy_port
$ export https_port=http://proxy_hostname.com:proxy_port
$ export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com,0.0.0.0,::1"

Using Mycroft behind an authenticated proxy

If you are behind a proxy which requires authentication, add the following environment variables, changing the proxy_hostname.com and proxy_port for the values for your network. These commands are executed from the Linux command line interface (CLI).

$ export http_proxy=http://user:password@proxy_hostname.com:proxy_port
$ export https_port=http://user:password@proxy_hostname.com:proxy_port
$ export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com,0.0.0.0,::1"

Getting Involved

This is an open source project. We would love your help. We have prepared a contributing guide to help you get started.

If this is your first PR, or you're not sure where to get started, say hi in OpenVoiceOS Chat and a team member would be happy to mentor you. Join the Discussions for questions and answers.

Links