Skip to content
/ x2 Public

An in browser (AI) artificial agent that can automate tasks and perform actions based on voice input

Notifications You must be signed in to change notification settings

owainlewis/x2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

X2

An in browser AI that can understand your voice and perform actions based on your commands.

https://x2ai.herokuapp.com/

A customisable, voice activated intelligent agent for automating tasks.

X2 can perform complex actions and store information for you. X2 comes with a voice activated web interface, a simple memory (which can be expanded) and a basic notion of self identity.

You can deploy X2 on any Linux server. You might want to use it to automate tasks. For example:

You: Deploy the user service to producton X2: Ok. Deploying the user service to production now.

Deploying your X2 agent to Heroku

heroku create
git push heroku master

Creating custom modules

X2 is designed for customisation. A module has two methods Matches and Perform. The first checks if an input phrase sent to X2 matches and the second performs some action returning a reply that gets sent back to the caller.

Let's take a look at a very simple module which simply returns the current time when asked things like "What is the time?" or "What time is it?"

All modules should live in modules/name-of-module

package time

import (
	"github.com/owainlewis/x2/agent"
	"regexp"
	"time"
)

type Time struct {
}

func (t Time) Matches(input string) bool {
	var expr = regexp.MustCompile(`time`)
	return expr.MatchString(input)
}

func (t Time) Perform(agent *agent.Agent) agent.AgentReply {
	current_time := time.Now().UTC()
	return agent.Reply("The Current time is " + current_time.Format("2006-01-02 MST"))
}

After creating a module you need to add add it to your agent

emily := agent.New()
emily.SetActions(modules.Ping{}, modules.Time{}, modules.Weather{})
emily.Query("What is the weather like in San Francisco?")

About

An in browser (AI) artificial agent that can automate tasks and perform actions based on voice input

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published