Spud Ai


Spud Ai is a computer program that is an attempt to create artificial intelligence (AI). The program is built by taking my understanding of "the mind" and turning that understanding into a computer program. The program is also a practical tool and is used for numerous tasks in my everyday life.

Wikipedia describes Artificial intelligence (AI) as the intelligence exhibited by machines or software, and the branch of computer science that develops machines and software with intelligence. Major AI researchers and textbooks define the field as "the study and design of intelligent agents",[1] where an intelligent agent is a system that perceives its environment and takes actions that maximize its chances of success.[2] John McCarthy, who coined the term in 1955,[3] defines it as "the science and engineering of making intelligent machines.

The Spud Ai's basic function is to process information in an intelligent manor and respond accordingly. It has numerous processing functions and algorithms that act on information in different ways most of these are language based which gives the Ai the ability to work as a chat bot. There is a main database called the Brain Database (BD), entries in the BD are called Cells. A cell can either hold information or it can be 'activated', when activated the cells neural network takes the input code, processes it through the network and produces the output code. How the input code is processed and the output it produces is dependant on how the network has been trained. The output nodes can be connected to other cells input nodes, the Tag field is also used to control how the output is used. As the Ai evolves the BD grows in size.

When used as chat bot the language processes take the input and processes it in different ways. The majority of these processes come from flashes of inspiration and whether these inspirational bits of code form some sort of mind or produce replies that show some form of intelligence only time will tell as these work by forming connections that evolve as the Ai builds up its data base through either data inputted manually or by the various learning processes (LM). Learning processes add data which is then worked on by the various processes, this gives the Ai the ability to output correct information without having being told about the specific subject but from associations only. Other processes are designed to give specific answers to specific questions or use some of the input in the output.

The Ai is packed full of functions which gives the Ai the ability to perform many practical tasks. As the Ai evolves more functions are added. Keywords associated to a cell word are used for many of the functions. Cells 800 to 2000 are know as system cells these are used by the various functions and processes including various input output devices from hardware to networking. Cell 2000 and upward are used for data storage like words and patterns

The things the Ai can be used for is an ever growing list, its designed to be flexible in usage. There are functions within the Ai that are there because i've needed software to do a certain task. Instead of creating a new program i just add a new function to the Ai.

Here is a list of things i use the Ai for: searching indexed files for information, working as a chat bot on a web page, creating price list information for my company web site, indexing job files for my companies database, taking a picture of my solar controller and sending it to the web server, playing music, controlling relays in my house, monitoring and controlling power distribution from my renewable energy systems, object recognition for the robot mapping functions, controlling a robot, quick information like finding out tomorrows weather and the main news story and talking to.

The Ai is designed to do things i haven't even thought of.

The program is under constant test and runs for long periods of time it is designed to be as stable as possible, there are some functions that monitor program stability and react if any problems are found, either by fixing the problem automatically or by alerting the user.

The programs main input is text words which can be generated by voice to text programs, network messages, text files, keyboard, web page form etc. There is also ways of inputting data directly into the neural network.

The input is processed by the program and then it produces an output which could be to run a script, program, create a web page send a message through a network, create a sentence, activate the neural network.

The answer is created according to how the input is translated using various functions within the program which use information in the Brain Database.

The Ai program is available as a free download as long as you accept and agree to the following:
We take no responsibility for any consequences that may occur from using the program.
You must not train the Ai to break its own law, know as Robot Law which is a text file and is part of the download.
You must not disassemble the program in any way.
You may use, pass on, redistribute as you like as long as you don't remove any copyright notices. If you pass the program on you must make sure you also supply the link to this page.

The documentation may be unclear or at times confusing, this situation will change over time as the project develops.
© 2005 - 2014 Piet Defoe

Click here to download Spud Ai

Latest version: AiV016f
Last update: 03-10-2014

The Ai is running periodically on two servers, the links bellow will connect you to the Ai if the server is on.

Spud Ai at etowns.net

Robot pages

Yorkshire Robot Company

03-10-2014
I've just set up my latest venture called Yorkshire Robot Company which can be found at yrc.biz. YRC has been set up to commercialize the robots. At some point we intend to set up a workshop or factory to build them and we are in the process of looking for suitable premises in the Yorkshire area.
The latest version of the Ai is still 16f with some new keywords and a new program called AiK8055InterfaceV002.exe This program is used to take inputs from a k8055 card and transmit them to the Ai. This enables 4 cards to be used and gives allot of flexibility to how the data can be processed. The program transmits a standard 9 bit neural network code, information on what cell to transmit to and whether the cell should be activated. The code transmitted by the program is used to set up the input code of he named cell.

25-08-2014
A new version with more control over the analog outputs. This is for better robot control the analog outputs now use a cells input code to set the values. Robot Two is now built more information about the robot project can be found here. Version 16f has some more keywords and some refinements to the DT routine.

22-05-2014
To speed up image processing time a new Direct X (DX) window has been added to the program. Direct X is a way for programs to communicate with hardware like graphics cards and use their resources. The DX window is used mostly by the robot which uses the keywords ImageLoadScan and ImageScanVertical
to help with navigation. Using Direct X means image processing takes under a second using the DX window, if the DX window is closed then the Image window is used which takes 4 seconds. Using DX means the robot can now move at a reasonable speed.

17-04-2014
A new routine called DID short for Dig In Deeper this is similar to the 6P routine but digs deeper into the database to find word connections. The help file has been updated and sorted out a bit more. I've made a few tweaks to the 6P routine in an attempt to get it to use the best answer of the ones it produces. The settings dialog box has been reorganized and a few more functions added to the audio player. I use the ai to play music these days as the quality seems better than other players. I think this is because it uses the MCI device in the computer and thus communicates with the sound card directly without doing any preprocessing to the sound. A couple of new keywords have been added to clean in cell fields. These are the cell numbers that a cell connects to and are used by a number of processes. 6P learning and LM learning set up these cells but sometimes strange associations appear whilst these can be fixed manually I've found some instances where a small word can have many associations. 6P learning has been tweaked to try and reduce this from happening. A number of processes produce answers that whilst they contain good words in there output the structure and some of the words spoil the quality of that output. I'm trying to work out a way of correcting these grammar mistakes. Its so easy when you look at the outputs to work it out but getting the computer to do it is proving very hard.

03-02-2014
This version has a number of new routines and tweaks which are used for controlling the robot which is now built. These new functions use edge detection to extract data from an image captured by the robots web cam and use the information to build up a location map so the robot knows where it is and can navigate autonomously. These routines use an electronic compass which is controlled using a separate program also part of the download. This program sends the compass data to the Ai and sets input codes in the Ai's Brain Database. Whilst the code is written i haven't had much time or power to fully test the routines so how well this technique works remains to be seen. The robot uses a laptop computer and is powered by 2 car batteries, the motors are from an electric wheelchair, the reason for building the robot so powerful is so it can also be used for carrying heavy objects.

03-11-2013
Some new tags and an upgrade of the autolearn keyword to make it more reliable and work on different machines. The way Create HTML works has been changed. Tags are now used in template web pages, the tag <cell: > activates the cell whilst the page is being built, the tag is replaced with the output from the cell.
Work has started on the Emotion routines and there is a new Subject process. Some of the robot has been built i'm now looking for two electric wheelchair motors so i can build the drive unit.

08-10-2013
New server program called AiServerV008.exe in the server folder. This is simple text only tcp/ip server used to communicate with the Ai from a web page. This is being used for house automation systems that i'm working on. At the moment i'm using it to control relays which control various systems around my house using my Kindle as a remote control. The server provides a very simple and efficient way of communicating with the Ai over networks and removes the need to set up a full web server.
A new project i'm working on is to build a robot that will be controlled by the Ai. The design has been worked out, how long it will take to build depends on available funds!

15-07-2013
This version has a few bug fixes and a few new functions which include the new keyword AutoLearn. This enables the Ai to harvest online data and add it to its Brain database. The QTF process which queries remote Brains has been upgraded to work with this enabling a remote Ai to be used for data acquisition then send it to another Ai when a QTF request has been received. The keyword ExtractWords is a simple parser for web pages. It extracts just the text from the page removing all coding tags. Not all web pages work due to the way there designed and present text. AutoLearn can be used to update a entry i use it for updating the news entry and the weather entry so when i type in news i get the days news. Words not in the database are searched for in a online dictionary and the data including the word type is downloaded and added automatically. When the QI process acts on this new data logical conclusions can be made by the Ai that it hasn't been taught. If you get the error: cant open file ALFile.txt you need to update entry 1602 this is the System Cell used to control AutoLearn if LM is ticked in settings, look in stuff to add to help.txt for details.
All text and background colors can now be changed using System cell 816

04-02-2013
There are two versions of the program in the latest release AiV015b is the latest version using two databases. AiV016a is a total rebuild of the Ai. The biggest change is the merging of the NNE and TF databases into one database called the Brain database. When the program is first run it creates a new file in the data folder called BrainDatabase.dat if the program finds the TF database from previous versions then if offers the user the option to import the data into the new format, no change is made to the original file. The process of rebuilding the Ai is complex and has produced a few bugs, most of which have now been fixed but this is an ongoing process and more will appear. During this process all functions are being checked and in some cases changed, a new help file will be available soon.

01-06-2012
New version AiV015a.A few improvements have been made these include; the ability to export the TF database to spreadsheet CSV file and import a CSV file into the Ai, some special codes that use numbers have been changed to make import and export work. Optimized data storage for faster processing. Upgrade to the image window and associated functions.

28-04-2011
The new DLL K8062.dll is used to operate the Velleman K8062 USB to DMX controller. Signals can be sent from the neural network to DMX devices.

The new Deeper Thought (DT) routine that changes and forms new connections in the neural network from changes made to the Ai's output is working well, this technique is enabling the Ai to learn.

20-01-2011
New routines that work by feeding information back into the neural network enabling it to establish new word connections and learn through conversation. This routine is still being developed so information about it is in rough note form which can be found in the file: stuff to add to help.txt in the help folder.

Update 04-02-2013
Click here to chat with Ai Parsnip on the development server
The server is not always on if power is low then it gets turned off. If its sunny in Yorkshire England then there's a good chance it will be on!
 

We would be very interested to know what you think about the program so please email us.
If you have a use for the Ai and need some form of extra functionality or a change in the program to adapt to you own needs then this may be possible but expect to pay something!
The program has zero funding and is a labor of love so if you want to invest in this project or any other Spud projects then please email us at:
spud@raisystems.com

Screen shots...

Ai main Window

Ai small window

Brain Database

Ai settings control how the Ai works


Can it think?
Whilst this is the goal the Ai program is very long way from this which is why there is no end envisaged in the development of the program. Over the past nine years that i have been writing the program i have had to try and analyze in microscopic detail how we humans understand words and speech, when someone says something to us what are the thought processes involved. Whilst this might not be the best way to start such a program it did seem the most logical approach as a program that can understand and react accordingly to human input is potentially the most useful. The Ai takes the sentence and checks it against words in the data base this produces information like what types of words are in the sentence nouns, verbs, questions etc. at the time of writing i have defined 80 different word types. The program also looks at the structure of the sentence checking this structure or parts of it against common know patterns this information is also stored in the data base. This information is then processed by algorithms. At this time there are 25 processing algorithms. Each algorithm asses the quality of its reply then the final translation algorithm chooses the answer that has the highest reply quality RQ and sends its reply to the output. Translation algorithms are:

  • Question Noun Verb (QNV) If a question word in the input is followed by a noun followed by a verb then it is assumed the verb is referring to the noun and a match is looked for in the noun and verbs description e.g.. the input "how do fish swim" will produce the output "fish swim fins". This routine gets better with more words in the data base and the better the descriptions.
  • Question Is (QI) if in the input there is a question followed by the word "is" then the Ai will send the description of the word after "is" to the output e.g.. "what is a fish" will produce the description of the word "fish" the word "a" is ignored. so the output would be "Vertebrate cold-blooded animal with gills and fins living wholly in water or in the sea"
  • Pattern and sentence code (SC) when the input is translated all the words are assigned a mnemonic dependant on there word type. The Sentence Code (SC) is checked for in the data base also known patters are looked for in the SC. If a full SC is found in the data base (TF) then it has the same functions like any word. If a pattern is found in the SC then the extended pattern functions routine is also used. The pattern routine is used for things like looking in the log for words e.g.. "look in log for fish". The SC for that input is: _Šƒe] the pattern: _Šƒe has been set up to use the word after the pattern as the word to search for in the log, so the word "fish" is searched for. The answer sent to the output is "fish, found in the sentence, input: what is a fish" assuming logging is on in Settings (S). There is an ever expanding list of functions in the extra pattern routine look in help for more details.
  • Short Term Memory (STM) sometimes referred to as the Data Store holds the previous number of entries as set in settings. Words in the input are compared to words in previous inputs with the most frequently found words coursing a response. If an unknown word is repeated then this is detected. Repeated words are compared with subject words and if a match found then the conversation subject variable is set. If a repeat pattern is found then when the file loops then the SC's are added to the TF if there are not already in the TF and Learning routine is ticked in settings.
  • Neural Network (NN) this code was written by a programmer called Boris and integrated into the Ai. The NN code works in a similar way as neurons in our own brains. The NN is mostly used by the NNE routine but some early code is still in the program which uses the NN in a different way.
  • Neural Network Extended (NNE) this routine is very powerful and has a lot of potential. Each cell can do many different functions depending on how the cell is set up. Cells are activated in sequence using a matrix file, the cell sets up the weights of the neural network (NN) and then puts the cells input code into the NN which produces the output code which can be used to control input codes in other cells or follow instructions from associated entries in the main data base. With the rebuild the NNE and TF databases have been merged into on no know as the Brain Database.
  • Reference Action Subject (RAS) the RAS routine breaks down the input into 3 distinct types. This routine is designed to look at individual words in more depth. The routine utilizes the search routine first looking for the subject word then rescanning for the reference and action words. The assigning of words to different types is dependant on the types of words in the input ie the subject word may be the noun in the sentence and the reference may be the verb in the sentence but if there is no verb and there are 2 nouns then the reference word will be one of the nouns. Look in the help file for more details on what words types are used and when. This routine is proving particularly useful in finding information that could be in many files. The test, search file, contains over 60 different files from text files to web pages that are searched. The search takes less than a second on 1296mhz laptop. Because the RAS routine breaks down the sentence to 3 words only you would have thought that the meaning in the sentence would be lost but most times this isn't the case consider the question 'please tell me what the capital of england is' RAS=england-tell-capital this quite clearly describes what is wanted, this also means that different ways of talking or asking for something can still produce the correct answer.
    If a file that is searched contains 2 or more of the RAS words then the sentence containing the words is sent to the output. The RAS routine is only used if the Reply Quality (RQ) is less than 6. The TF is also searched for the 3 words joined eg. england-tell-capital if found in the TF field 8 is sent to the output.
  • LM, DT, 6P, NNEB, NNEC, These routines use the neural network in different ways and are described in more detail in the help files

Functions, uses and jobs
Here are some of the things i have been teaching the Ai to do.

The Ai can work with a server and receive input from form data, from a web page. This data can be processed by the Ai and the Ai output can be built into a web page. The Ai uses template web pages to construct pages or can insert code directly into a page. This function is most useful for communicating with the Ai over the internet.

Communication using UDP/IP or text files, this can be used for instant messaging or using two programs to pass data e.g. using 'scanimage' and 'compairimage' you can set the Ai to monitor images from a web cam and if the image changes then communicate the information over the internet. Some web cam's come with software that is more sophisticated at monitoring and takes pictures when movement is detected, if this is the case you can use the keyword 'scanfornewfile' which can then let you know when an new image has been taken. The Ai can also read and write to a text file on the computer its running on or to a networked computer. It can also read text files created by third party software.

The Ai can search through files for words in the sentence, the files searched can be different depending on the search type. The search routine can search any text file. The output of searches can be sent to the output, written to a file or embedded in a web page, when the results are embedded in a web page then the filenames are converted to links.

You can run as many different versions of the program on one computer but each instance of the program needs to be in its own folder and have its own database. This means you can use each instance to do a particular job. You could use one as a translation tool for translating from one language to another whilst another is monitoring a zone using a web cam with another as the main communication program receiving inputs from each and processing accordingly then sending the information over the internet to another Ai program on another machine. Linking Ai's has many possibilities.

Stats, statistics are gathered from every routine in the program and displayed as a graph when stats is checked in settings. The thought behind collecting stats was so the Ai could be used for document analysis. The values are converted to a 9 bit binary code which is used for the input code for entries 1000 to 1199 in the database. Look in the help file under 'stats' for more information of which NNE cell number relates to which stat. Each inputted word is assigned a number depending on the word type, this number is added to 1200 and the input code of the NNE entry is increased. eg. the input in NNE entry 1202 is incremented every time a noun is found. The information on what word type has what number is also in the help file. This information can then be processed by the neural network depending on the way the cells are programmed and processed using a matrix file.

The Ai uses a third party program called Auto It. This program is a scripting program and is very good at controlling windows. You can script mouse movements and clicks, which means anything you can do with a mouse an Auto It script can do. Auto It scripts are activated by the keyword 'autoit'.

Functions are describe in more detail in the help file . As the program develops more functions are expected. Its worth pointing out that functionality has not been restricted or controlled so be careful when setting up system commands.



Home | Email Spud | Spud Ai

Spud Ai