**KRAM Assistant**
Proposal & Blueprint
What is it?
===========
**This is a voice assistant that will automatically just work with any custom
feature script you give it.**
Demos
-----
[ ] [Play music](#demos/playmusic)
[ ] [Summarize work email](#demos/summarizeworkemail)
[ ] [Reminder to leave for trip on time](#demos/remindertoleavefortripontime)
[ ] [Todo reminder helper](#demos/todoreminderhelper)
The checked demos have are further described in the [demos section](#demos)
How it might work?
------------------
********************************************************************************
*
* Speech Interface <--.
* \ \ External Script: Play music
* '--> Assistant ------> (Description)
* /
* / External Script: Summarize emails
* v (Description)
* Visual Interface
* External Script: Reminder to leave
* (Description)
* ...
* ...
* ...
* ...
* ...
* ...
*
********************************************************************************
### Speech Interface
This component is responsible for parsing verbal speech into text and text back
into verbal speech. This will include managing the connection to the
microphone/speaker and anything else needed. Think of it like a black box where
verbal speech goes in text comes out and text goes in verbal speech comes out.
**Tools that might be relevant**
- aplay
- vosk
- speech-recognizer
- arecord
### Assistant
This is the intelligence of the system, but it need only be intelligent enough
match a request with a description of action. There are a few things the
assistant should be capable of.
1. It should be able to hold a semi decent conversation
2. It should be able to identify requests/commands and match that
request/command against a list of possible actions (each action has a
description of itself)
If the input to the assistant is something that can be solved with a known
action, then trigger the action (External Script). If not then just respond like
its a conversation.
### External Scripts
These are scripts that do things. They could be python, bash, perl, lua,
anything as long as its triggerable with a cli call. They have a natural
language description of what the script does. When the Assistant needs to do
something it uses this description to determine whether this script will do what
is needed. If it will it will trigger this script.
* Use decorators around a fixed api to set up and clean up after external
scripts
### Visual Interface
Speech is slow and has a low bandwidth. Visuals are faster and can communicate a
lot more in a smaller package.
> "A picture is worth a thousand words. Yada yada yada"
> -- Someone Clever (Probably)
The

visual interface will be the systems means of
[backchannel](https://en.wikipedia.org/wiki/Backchannel_(linguistics)
communication. The visual interface should fill in the gap for when a user might go "Is this
thing working"
I have a few thoughts this topic but I'd rather y'all get a chance
to think on this before being influenced by my thoughts
- The system hosts a live reloading site that showcases the current state of
the system. Anyone visiting the site can see the current state of the
system.
- Condense the state of the system into a json and make it available
at an endpoint. (REST/Websocket/Anything). Then we can make
any sort of front end freely and independently.
- App that sends push notifications on phone
- PC utils that show status in task bar notifications
- Hardware component that lights up LEDs to indicate status
External Scripts
================
These are some script that I think would be cool to have.
Play Spotify
------------
We should have a few scripts that control a spotify session using the
[spotify api](https://developer.spotify.com/documentation/web-api).
Similarly we should also have a script to control a media player playing local
mp3s.
Leave the house reminder
------------------------
A script that uses google navigation api to remind you to leave the house at the
right time to get get where you want on time.
Open applications
-----------------
- Scripts to open applications on your computer/phone/smart tv.
- Scripts to initiate calls on your phone
Summary Scripts
---------------
Scripts to summarize emails/discord messages etc.
Demos
=====
Play music
----------
Summarize work email
--------------------
Reminder to leave for trip on time
----------------------------------
Todo reminder helper
--------------------