PearAI on Ubuntu 24.04

PearAI vs. My Codebase: When AI Hits Its Limit and I Hit a 404

Mohammed Essaid MEZERREG
4 min readOct 16, 2024
Cover image by the Author using Excalidraw.

Since I’m using Ubuntu, I had to follow PearAI’s Linux installation guide, which goes something like this:

  1. Download the tar file.
  2. Untar it 😃.
  3. Run the installation script with root privileges.
  4. Use an alias to avoid typing the capitalized name every time.

The installation script is definitely written by AI 😄 — I’d bet on it. Even the messages during installation, or the logs, feel like they were generated by an AI model. It’s almost certain that the tarball you download from their website is mostly AI-generated. Probably their AI, assuming they have one. Maybe they wrote it using their development copy of the editor.

If you’re a developer like me, you’ve likely noticed the shift in CLI-based tools, especially in terms of design and aesthetics. Gone are the days when everything looked like my first console project in Pascal or C. I remember writing a function like the one in the pearai_manager.sh file to display a menu. It went something like this:

# Function to display the main menu
display_menu() {
clear
echo "================================"
echo " PearAI Manager v$PEARAI_VERSION"
echo "================================"
echo "1. Install PearAI"
echo "2. Uninstall PearAI"
echo "3. Exit"
echo "================================"
echo -n "Enter your choice [1-3]: "
}

Looks like VS Code, right? Well, they mention it on their front page.

Testing PearAI with Moodle

I’ve been working on a Moodle plugin for a client. The logic is simple, and it’s almost complete. So, I figured I’d test PearAI on it. I loaded the entire Moodle code base where my plugin resides and opened the chat interface. My prompt was as follows:

This @Codebase is a Moodle codebase.  
I created a local plugin called @chatsettings that tries to add and customize the @mod_chat module plugin.
The @chatsettings plugin uses AMD modules, which are JavaScript-based, to perform these changes.

The main changes are:

1. Assign a color to each user in the chat session.
2. When the user presses Enter, it should insert a newline instead of sending the message.
3. The user can change their name in the session with the command /username a_new_name.
4. Users can download a chat history, including messages and any changes, like name changes.

I’ve already implemented some features—like assigning colors and part of the newline logic—and I’ve partially completed the history feature. I’ve also started working on the username change feature, but got sidetracked with another project.

My approach was to keep everything within my plugin, without modifying the core `mod_chat` code. But as I began the third feature, I found myself needing to modify core files. So, I devised another approach:
- Copy the `lib.php` and `module.js` files from the `mod_chat` module.
- Modify them according to my requirements.
- Add a log or history table to the database.
- Create a script that, during installation or upon admin command, copies my versions of the files to the `mod_chat` codebase.
- If the plugin is uninstalled, the script will restore the original files from Moodle’s GitHub repository.

Now, I know I’ve said a lot. Please, finish the job for me! 😉

Here’s your blog post with some revisions to improve clarity, coherence, and flow, while preserving your original style and tone:

Too Much for PearAI?

I tend to push AI tools hard, especially when they claim to have everything figured out. I don’t hold back when explaining my ideas or what I’m trying to accomplish. But PearAI couldn’t handle it.

At first, it focused only on the first part of my prompt and ignored my instructions about modifying the core mod_chat plugin. I had to remind it about the second part. After trying really hard, PearAI eventually hit a wall, saying I’d reached the context limit—much like Bing Copilot or ChatGPT would say.

Here’s the error I got:

Context limit reached.

HTTP 500 Internal Server Error from https://stingray-app-gb2an.ondigitalocean.app/pearai-server-api2/server_chat

{"detail":"500: Unfortunately, the conversations context length limit has been reached. Please continue in a new chat."}

Codebase Indexing Issues

Frustrated by the context limit, I decided to stop the app. But before doing that, I noticed a progress bar — apparently, it was still indexing the workspace or codebase. I don’t know when it started, but it seemed to take forever.

Interestingly, when I tested it with just the plugin I’m working on, the indexing finished in seconds.

Maybe It Already Knows Moodle?

Given that PearAI is based on ChatGPT (or a custom model), I thought, “Maybe it’s already indexed the Moodle codebase from GitHub or another user?” 😃 But when I tried adding the chat plugin without loading the whole Moodle codebase, I hit another dead end. When I clicked “Add more context providers,” I got redirected to a 404 page, complete with someone’s face on it. Most likely the founder.

404 page of PearAI.

Maybe Next Time…

At this point, PearAI isn’t useful for my development needs — at least not for this type of work. It might be helpful for learning, though. I’m currently exploring Ruby, Elixir, and Go, so perhaps it can help me better understand those languages or do things properly.

I tried PearAI because my brother recommended it — he uses it for his work, and, according to him, it’s been great. Almost perfect.

Let’s see what the future holds. Maybe next time it’ll be up to the task.

--

--

Mohammed Essaid MEZERREG
Mohammed Essaid MEZERREG

Written by Mohammed Essaid MEZERREG

A Software Engineer. Specialized in online education systems. Going through a life changing experience recently. Working on devlms.com

No responses yet