top of page

I tried making an AI 4

Jun 10
3 min read

I had been thinking for some time about whether it would be possible to create an AI that reflects my own personality and way of thinking.

For now, I've created an AI that can converse via a web browser, although it's just a prototype.

Initially, the format was simply text-based dialogue, which felt rather bland on a black screen.


However, simply displaying text on a black screen inevitably gives a sterile impression.

In the future, I'd like to create an interface where a face, like the wireframes in The Matrix, can speak, but it will take time to develop it to that level.

So this time, I decided to drastically downgrade and use emoticons similar to those on smartphones. It's a simple implementation, but just adding expressions makes a big difference in the overall impression.


1. Serverization using FastAPI

The biggest achievement this time was being able to turn the AI we created into an API using FastAPI.

As a result,

Browser
↓
FastAPI
↓
TAKA AI
↓
Response
↓
Browser

This configuration was successfully implemented.

Previously, this functionality could only be used within Python programs, but now it can be accessed through a web-based interface.

Through this development,

  • HTTP communication

  • API

  • JSON

  • FastAPI

I was also able to understand the relationship between them.


2. Web Interface

The front-end was created using HTML and JavaScript.

This system sends the entered information to an API and displays the returned response on the screen.

It's simple, but it allows you to "have a conversation with the AI you created in a web browser."

We were able to achieve that much.


3. Emotional expression added.

Since we were going to display faces anyway, we also implemented emotional expressions.

For example, if an insulting word is detected,

  • His face looks angry

  • The response is also angry.

I try to do that.


However, it returns to its normal state after receiving an apology.

In this area, the focus is not on making it just a chatbot, but on making it behave like a character.


4. Things I learned from making it

What I learned from actually building it is that current AI is not a large-scale language model like ChatGPT. The current system is:

Question
↓
Search TrainingTable
↓
Retrieve corresponding answer
↓
Response

That's the general flow. To put it extremely, it's similar to "a database of a large number of if statements."


Therefore, there are still many instances where conversations don't make sense.

However, since the learning data is stored in the database and its update status can be checked, I believe that improvements can be made by patiently increasing the amount of learning data.


5. Future Challenges

Currently, we are not able to utilize all the parameters that make up an individual.

We have prepared several dozen emotional status items, but we only actually use a fraction of them.

Furthermore, personality reproduction is still a work in progress.


In the future,

  • Personal experience

  • way of thinking

  • Judgment criteria

  • Likes and dislikes

I want to input things like this and have them reflected in the personality development parameters.

Ultimately, the goal is not an "AI that answers questions," but an "AI that thinks and reacts in its own way."

I want to get closer to that goal.


6. Summary

What I've created this time is still just a prototype.

but,

  • Create your own AI

  • Convert to an API using FastAPI

  • Enable conversations via the web.

  • Add emotional expression

Experiencing that whole process was a great gain.

I learned a great deal technically, and I think the results are quite satisfactory as a foundation for future expansions.





 
 
 

Comments


bottom of page