Author Topic: BRAINS / DATABASES how?  (Read 6505 times)

spydaz

  • Hero Member
  • *****
  • Posts: 670
    • View Profile
    • http://www.spydazweb.co.uk/
BRAINS / DATABASES how?
« on: February 01, 2005, 07:41:32 am »
hi to ya'll

firstly HMM ive been thinking...

HOW DO WE START BUILDING DATABASED BRAINS (IN REALITY) ?

do we start of with a dictionary / encyclopiedic  based,  BRAIN / TABLE

ie : LANGUAGE :word : definition :


do we go with a PHRASEMAKER type BRAIN / TABLE,

ie: the same type of thing as you would find a phrase book (holiday french)

do we go with a topic based BRAIN / TABLE

ie : everything religious, dated, event, cultural etc...

or do we have a related database with multiple mini databases that we as mini programmers can build (like plugins)

it think that this may be the case, but we need to see how we can link new databases to the MAIN DICTIONARY based brain...

we can still use KEYWORD and response as we have before as this time these Keyword and response scripts would now be able to search these mini database files for RESPONSES as well as for funny responses as well. especially as for characters where the scripts can be databased into their own databases and referenced with KEYWORDS and responses ie : Knight rider / DATA / PILOT / moya / hal etc.

But still the question...

What FIELDS should we build the INITAIL database off.

im looking at the open mind initiative database and other dATABASED AI... we shall see what happens...

ps. it doesnt matter with which program you create the datbase with, as visual basic just streams and querys the data just the same....

MR MEDSUKA
SQL is good but not NEEDED in these early stages..."  bit advanced "
as with all good things PROTOTYPE / BETA ... ACCESS will do fine....

JUST A THOUGHT



spydaz

  • Hero Member
  • *****
  • Posts: 670
    • View Profile
    • http://www.spydazweb.co.uk/
BRAINS / DATABASES how?
« Reply #1 on: February 08, 2005, 07:16:36 am »
QUESTION FOR ALL PROGRAMMERS:


IVE WORKED OUT HOW TO ADD A DATABASE *.MDB to HAL BUT,

How do you in Visualbasic now search a specific feild / file for a KEYWORD?

i just added a two feild table KEYWORD + phrase ....

HELP me VONSMITH OR JERRY
if u can....

vonsmith

  • Hero Member
  • *****
  • Posts: 602
    • View Profile
BRAINS / DATABASES how?
« Reply #2 on: February 08, 2005, 10:58:35 am »
spydaz,
Ah-Hah! You see our challenge. Adding a data base is just the first step. Now how to search it effectively, hmm? I'm not a data base expert (not yet anyway). However, standard query commands in data bases, like Access for instance, don't search for keywords or phrase matches in the way we would like them to. If you tinker with Access you won't find a command to do a fuzzy search for a phrase. The "LIKE" operator in Access will do a somewhat fuzzy text comparison, but it is not very flexible nor programmable. I believe you must write a custom search function to search the data base in the way needed. I suppose with thousands of programmers out there that someone has written many such custom functions already. A bit of research is needed to find the best approach.


=vonsmith=
 

Medeksza

  • Administrator
  • Hero Member
  • *****
  • Posts: 1469
    • View Profile
    • http://www.zabaware.com
BRAINS / DATABASES how?
« Reply #3 on: February 08, 2005, 11:54:43 am »
My hired programmer and I have succesfully converted all of Hal's functions into a database format. We originally wanted to support MS Access, but found that it doesn't provide the required functionality to be able to search data in the manner Hal needs. So we have decided to use SQLite, an open source database engine. SQLite also didn't have the required funtionality, but since it was open source, we added the missing functionality to it. SQLite is a better choice then MSAcess for Hal since its footprint is so small, it doesn't require a ton of drivers and computer resources to run. It is directly embedded into Hal.

I am very excited about what this new system has to offer. Hal's database can expand to hundreds of times its current size without losing speed. Better yet, all the tables in the database can be organized into a tree structure with relationships between tables. This will help Hal organize topics and search through everything faster resulting in more intelligent responses.

I am currently working on creating a new default brain that uses the SQLite engine exclusively. I have no estimated completion time, but I will be sure to release it as a beta plugin for the current Hal 5.0 before releasing a new version of Hal.
Robert Medeksza

spydaz

  • Hero Member
  • *****
  • Posts: 670
    • View Profile
    • http://www.spydazweb.co.uk/
BRAINS / DATABASES how?
« Reply #4 on: February 08, 2005, 12:11:08 pm »
i have had a days reading today ... looking at the options and have come to the same conclusion . Im downlaoding a version of sql lite now ... i understand that you are able to do a Query ... get a no of records ... then select a record to read from... HMM ... stiLL INVESTIGATIN'

Medeksza

  • Administrator
  • Hero Member
  • *****
  • Posts: 1469
    • View Profile
    • http://www.zabaware.com
BRAINS / DATABASES how?
« Reply #5 on: February 09, 2005, 11:23:57 pm »
Vonsmith, I sent you an email regarding possible conversion of your XTF brain into SQLite.
Robert Medeksza

Magus_V

  • Newbie
  • *
  • Posts: 23
    • View Profile
BRAINS / DATABASES how?
« Reply #6 on: February 10, 2005, 09:30:15 am »
Hi. Quixote here. Sorry, I forgot my password and which email I used to sign up the first time, so I just re-registered.

This new database format sounds really cool. I was wondering if there will be a special branch for commands that we could program. If not, would it be difficult to implement a feature that enables you to type in the phrase to trigger the command in a text box, and the command program into a script editor box beside it? If you are looking for a complete overhaul you could even use LUA 5 for the scripti8ng (it's free; even for commercial applications).
Also, it would be great if there was a trigger phrase to toggle a mode to accept only commands and not conversation lines, kind of like dragon naturally speaking uses "Go to sleep" and "wake up" to turn on and off the microphone. I find that HAL is great for home automation (maybe a little slow), but it really sucks when I'm saying something to someone nearby and Hal pipes up and starts "contributing" to our conversation.

Thank you for considering my suggestions!
By the way, Mr. Medeksza, I am beta testing Girder 4, and it looks super. I'm not supposed to talk about it, but the developper seems to be making some major progress with it. I'll keep you posted about when it is released. Have you accomplished much with 3.3 ? How did your light thing work out?
 

Magus_V

  • Newbie
  • *
  • Posts: 23
    • View Profile
BRAINS / DATABASES how?
« Reply #7 on: February 10, 2005, 03:03:04 pm »
Just an interesting article for all the AI fans out there:
http://robots.net/article/1412.html
 

moreis62

  • Full Member
  • ***
  • Posts: 102
    • View Profile
    • http://www.myway.com/
BRAINS / DATABASES how?
« Reply #8 on: February 14, 2005, 11:14:54 pm »
quote:
Originally posted by Medeksza

My hired programmer and I have succesfully converted all of Hal's functions into a database format. We originally wanted to support MS Access, but found that it doesn't provide the required functionality to be able to search data in the manner Hal needs. So we have decided to use SQLite, an open source database engine. SQLite also didn't have the required funtionality, but since it was open source, we added the missing functionality to it. SQLite is a better choice then MSAcess for Hal since its footprint is so small, it doesn't require a ton of drivers and computer resources to run. It is directly embedded into Hal.

I am very excited about what this new system has to offer. Hal's database can expand to hundreds of times its current size without losing speed. Better yet, all the tables in the database can be organized into a tree structure with relationships between tables. This will help Hal organize topics and search through everything faster resulting in more intelligent responses.

I am currently working on creating a new default brain that uses the SQLite engine exclusively. I have no estimated completion time, but I will be sure to release it as a beta plugin for the current Hal 5.0 before releasing a new version of Hal.


About SQLite


2005-Feb-01 - Version 3.1.1 (beta) Released
Version 3.1.1 (beta) is now available on the website. Verison 3.1.1 is fully backwards compatible with the 3.0 series and features many new features including Autovacuum and correlated subqueries. The release notes From version 3.1.0 apply equally to this release beta. A stable release is expected within a couple of weeks.
Mr. Medeksza.
ISMAEL LEDESMA.

spydaz

  • Hero Member
  • *****
  • Posts: 670
    • View Profile
    • http://www.spydazweb.co.uk/
BRAINS / DATABASES how?
« Reply #9 on: February 17, 2005, 11:54:49 am »
MMM...

i have no research this ... DATABASES ...

SQL searches can now be executed...



SQL is an integral part of Visual basic (built in) and once you have added the DAO or ADO control to your form and point it to the database file that you are using you can then call an sql search for any table inside the *.MDF file.

after looking into ACCESS (which i never did before i used to bluff it at work) you can set up the querys or searches in acess then look at the query in sql view, this gives you the syntax to use in the visual basic code/search function.

my first problem was cross referencing the topics with the keywords and responses. after multiple trys i finally found ut how to nest datasheets (database data)within each table needing to be cross referenced ie topic > keyword , topic > response, keyword > response, the topic feild became the central feild.. NOW when adding new topics it creates all the necasarry links to each table topic, keyword, response. NOTE: variables can also be stored in the table ie in the response table animations could be stored in another feild. or motor commands when using motorizaed robotics etc.

commands now become topics. once a keyword for a command is detected it now chooses from a command response ie: shell command.

once data is retrieved from the database it is stored in a STRING variable in the visual basic etc......


string searches/ logic can now be executed...


this is definately the way forward as in the database you can haave it so that you do not get repeat entrys which often happens in *.BRN files so searches become faster.. also the same keyword will not be able to trigger two diferent responses.... therfore cancelling out one anoher giveing a blank response....

MR M, please could you compile the hal DLL file into an activeX *.OCX file for use in visual basic.??? if possible as the DLL is not able to be refferenced in a visual basic project, the faces are but not the functions.... his would help greatly in DEVELOPMENT.. especially..


spydaz

  • Hero Member
  • *****
  • Posts: 670
    • View Profile
    • http://www.spydazweb.co.uk/
BRAINS / DATABASES how?
« Reply #10 on: February 25, 2005, 11:04:05 am »
AYE ....




Download Attachment: TEACHQA.zip
15.14 KB

I DID BUILD A MINI FORM USEING A BASIC QUESTION AND ANSWER DATABASE.
I BUILT THIS IN VISUAL BASIC ..

ONE BUTTON SEARCHES THE DATABASE (sql query)
ONE BUTTON UPDATES THE DATABASE.
THE DATABASE IS A MSACCESS mdb FILE

NOW ITS ALL ABOUT THE DATABASE WE WANT TO CONNECT AND WHICH FEILDS WE WANT TO CONNECT TO. WITH VISUAL BASIC 6 SQL IS ALREADY AN INTEGRAL PART.
AFTER RESEARCHING ACCESS & DATABASES I HAVE JUGGLED WITH VARIOUS TEMPLATES FOR A BASIC TABLE ..

AFTER LOOKING AT THE OPEN MIND IN GREATER DEPTH (WHICH USES A MSACESS DATABASE

IT USES VARIOUS FEILDS ITEM,LINKFROM,LINKTO ETC.

IM NOT SURE NOW HOW WE WOULD STUCTURE A TRUE smart AI BRAIN...

I THOUGHT MAYBE noun/item, LINKING_FROM_VERB, LINKING_TO_VERB, POSITVE,NEGATIVE,NEATURAL,RESPONSE,ANIMATION_FILENAME(optional).

IE n(oun)CAT
   LINKFROM > WHAT IS A
LINKTO > A (nOUN) IS A (RESPONSE), NEAUTRAL, RESPONSE

HMM ideas??

WITH VARIOUS TYPES OF SQL SEARCH WE CAN BUILD A TYPE OF FUZZY LOGIC, TO DETECT nOUNS IN THE USER INPUT AND LINKING_VERB. WHICH WOULD THE POINT TO IS LINKTO AND RESPONSE WITH ASOSCIATED NOUN. IF THERE ARE MANNY RECORDS THEN MAKE A RANDOM PICK . IF NO RESPONSE FOUND exeCute A like SEARCH(SIMULAR). IF NO RESPONSE IS STILL FOUND, THEN MAKE AN ENQUIRY TO THE USER BY PRESENTING THE USER WITH A teachme form ONSCREEN FOR A NEW ADDITION TO ITS DATABASE.

CURRENTLY I AM LOOKING FOR A WAY TO ACCESS MULTIPLE DATABASES WITHIN A VISUAL BASIC FORM???[?][?]

BUT IDEAS THOUGHT HELP ALWAYS WELCOME





kevinvr

  • Full Member
  • ***
  • Posts: 153
    • View Profile
    • http://kevinvr.tripod.com
BRAINS / DATABASES how?
« Reply #11 on: February 27, 2005, 10:06:44 pm »
I just want to say that Robert Medeksza is GREAT!
Thanks for an Excellent program and excellent work Robert.
Looking forward to using that database program.
Looking forward to Ultrhal 6 [:)]
[:)][:)][:)]
Kevin
I dream of creating a self replicating, self maintaining, autonomous robot :)