Experiences and Thoughts about Computers, Networks and their Applications

In my spare time, I’m helping a christian charity that runs their own IT helpdesk for about 1000 users, distributed across much of the globe. This helpdesk service is greatly appreciated by the users, but it is also absorbing (too) much of the capacity of the IT team.

Given that number of users, similar issues tend to recur. So the idea of a pre-screening website came up, that would ask certain questions and point to applicable instructions – or to a human (i.e. mail to RT), if there is no standard answer for the user’s situation.

In the computer science world, such a system is called an “expert system”, because it tries to mimic an expert. While looking for such a system for helpdesk use, I found surprisingly little that would match:

Existing Products

  • http://code.google.com/p/interactive-decision-tree/ : a very simple editor (PHP, creating an XML file) and viewer (HTML/JS/CSS, reading the XML file). Nice, working, but not flexible enough for the complexities of real IT issues.
  • CLIPS is a popular expert system, created by NASA, but almost without a web interface. The PHLIPS project provides a PHP extension, so PHP gets a basic interface to a CLIPS environment. Unfortunately, this only works reliably with Apache 1.3, because the multi-threaded architecture of Apache 2 causes stability issues with the single-threaded CLIPS architecture.
  • D3web is a huge Java framework, requiring a lot of effort to get a system going. Probably too complex for that charity.

All other helpdesk software I found was about handling tickets by humans, not solving the underlying issue by a machine.

Perhaps I just didn’t use the right search terms. Does anybody out there have an idea, what search terms would lead to expert system backed helpdesk or troubleshooting systems?

So without a web-ready expert system shell available, I started thinking how I’d create one. So far I have not written a single line of code, but the idea might inspire others to do it – or to point me to someone who has done something similar.

Client (Customer) Interface

  • The user (client, customer, person having a problem and looking for help) enters the website of (starts a session with) the expert system, e.g. helpdesk.example.com.
  • The user selects the area of trouble, e.g. “I can’t retrieve my e-mail”.
  • The system starts asking yes/no questions, e.g. “Are you sure that your Internet connection really works?”, “Has it ever worked after October 2011 (when we’ve changed servers)?”.
  • The user answers the question by selecting “yes”, “no”, “I don’t know”, plus possibly a comment field (e.g. explaining why the user doesn’t know the answer). Or maybe the user can choose “Could you please rephrase that question?”.
  • Depending on the user’s answers, the system asks more questions.
  • When the system is reasonably sure what the underlying issue is, it tells the user and shows proper instructions.
  • When the system has to give up (nothing more to ask, too few precise answers from the user) , it sends the log of the interaction to a human helpdesk technician.

Representing the Knowledge

The underlying expert knowledge needs to be stored in some data structure, residing e.g. in a database like MySQL. Here is my idea of how to represent that expert knowledge in a way that’s ready to use for a machine (program):

Fact

A short statement, represented by a short string (“atom” in LISP or Ruby parlance), e.g. mail_works, worked_after_server_change or internet_connection_ok.

For each session (user problem instance), each fact has a state of “true” (either by user input or by logical inference [see rules below]),  “false” (dto.), “user doesn’t know” or “not yet considered”.

The state of the interaction is basically the combined state of all facts.

Certain states of certain facts are solution candidates: If e.g. internet_connection_ok becomes known to be false, while looking for the reason of not (mail_works), then there is only one way out: “Go, fix your Internet connection”.

So the full data structure (database schema) of a fact is

  • ID (number for handling in the database)
  • atom_string (one word, suitable for an atom in an underlying expert system)
  • is_solution: whether and when this fact is a solution: “always”, “when_true”, “when_false”, “never”; the description should tell the user why.
  • for each session (possibly in PHP session storage): state
    • user_input: one of “not yet asked”, “true”, “false”, “don’t know”
    • user_comment: thoughts of the user, why he can’t tell or why he thinks it is the way he wrote
    • deduction_result: one of “not yet determined”, “true”, “false”, “don’t know”. May need to be changed, if the user changes his input at a later stage.

Rule

A description of a material implication, which combinations of facts determine the state of another fact, e.g.

not (internet_connection_ok) => not (mail_works)

account_settings_outdated => not (worked_after_server_change)

This needs to be handled with the full care and can be used with the full power of propositional logic.

a => b can be pronounced as “a implies b“, or if a is true, then (it can be implied with mathematical certainty that) b must also be true. If a is not true, then nothing is known about b. If b is true, then nothing is known about a, because b can be true for other reasons than a.
In the above example: if the internet connection is broken, then mail will certainly not work. But “mail not working” can be true for many other reasons than a broken internet connection.

By the rules of mathematical logic (the material implication (=>) works that way), a => b is fully equivalent to not (b) => not (a), so if b is false, then a must be false too, because if a were true, b would also have to be true, which it isn’t.
Applied to the above example, another way equivalent to put the rule is
mail_works => internet_connection_ok
In other words, if you know that your mail works, you can imply that your internet connection is working too.

It may require more than one condition to be able to infer a fact. So the rules need to have the option of at least two conditions, each of them negate-able, and a link operator (AND, OR, perhaps XOR); the result may be negated, so the full data structure of a rule is:

  • ID: for identifying the rule in the database
  • short_name: to keep a list of reasons short
  • long_description: human readable sentences what this rule is really saying and why it is true; optional but highly recommended
  • cond1_fact: ID of fact
  • cond1_negate: true or false; true means “negate fact1″
  • cond2_fact: ID of fact, may be empty if the rule depends on only one single fact
  • cond2_negate: true or false; true means “negate fact2″
  • operator: “AND”, “OR”, “XOR”; may be empty if cond2_fact is empty
  • result_fact: ID of the fact that’s being set by this rule.
  • result_negate: true or false; true means “set the fact to false if the condition(s) are true”

Question

Somehow the facts need to be given to the system. A machine is perfectly happy dealing with an atom-like fact, but the average end-user (typically an expert in theology, not technology) would feel being treated rude if being asked “worked_after_server_change ? yes/no/don’t know”.

So for each fact there should be one (or more, see below) longer string containing a question, e.g. “Are you sure that your Internet connection works?” This is a question most end users can answer with yes or no. Sometimes there may be alternative wordings for the same question. So there may be multiple questions for a single fact. One of these questions needs to be marked “preferred” (or get a numeric preference value, e.g. 1-100), so the system can know which one to present first.

Some of these alternative wordings may have the opposite meaning, e.g. “Are you currently experiencing trouble with your Internet connection, so you have problems visiting other websites too?”. So another attribute per question needs to be “meaning reversed” (yes/no).

In a worldwide user group, people tend to prefer different languages. So for each fact there could (or rather should) be one question per language. The user could specify his preferred language(s) in his user profile on the helpdesk system, e.g. “native German, good English, very little Japanese”.

So the full data structure of a question could be:

  • ID: to identify it within the database
  • fact_id: ID of the fact, the state of which would be set if the question were answered; there can be several questions for a single fact.
  • text: the string that’s going to be presented as a question to the user
  • language: id of the language the text is in
  • meaning_reversed: yes or no; yes means that answering “yes” to this question should set the fact’s state to “no”
  • level_of_preference: 0-10; higher preference questions will be suggested first to the user

Description

When the system describes what it has concluded (or what the user has entered), it should present its findings in understandable human language to the user. Because there are multiple languages (English for users, English for technicians, German, Spanish, …), a single description field won’t suffice. Additionally, a “yes” state and a “no” state may have quite different wordings. So there is need for a separate table of descriptions:

  • id: technical field for the database; possibly unneeded
  • fact_id: fact this description refers to
  • language_id: language this description is written in
  • fact_state: “true”, “false”, “don’t know”
  • text: the description of the fact when being in the specified state

Rule (Inference) Engine

Given all these (database) records about the state (within the session) of facts, rules and questions, the core logic of the expert system (I’ll call it “rule engine”) needs to decide, which question to ask the user next. Because each question is closely linked to exactly one fact, the task can be reworded to “determine, which fact to consider next”.

Core parts of the algorithm could be:

  • Facts with known state (yes, no, don’t know) don’t need to be reconsidered.
  • For each rule, check whether the rule could trigger (left side of the “=>” evaluates to true, right side is unknown or yet unconsidered) using the known facts. This method is called “forward chaining”. Enhancement: use the reversal law for rules having only one fact on the left side, i.e. right side of the “=>” evaluates to false. Further enhancement: do so with rules having a known right side fact and one of two known left side facts, if the states, negators and link operators permit to draw a conclusion.
    • If a rule can be triggered, trigger it, thus putting more facts into a known state.
  • For each rule, check whether it could trigger if just one (or, in “desperate mode”, two) additional fact(s) would be known.
    • take note of this “interesting” facts. If a fact becomes interesting in several rules, increase its score. If a fact would only be useful if a second fact is also known, then increase the score only by a little.
    • select the fact that has occurred most often and present its question to the user; record the answer, set “unconsidered” to false.
    • If no such fact (and corresponding rule) is found, give up, “can’t solve the problem with so few supplied facts”, send the log of the session to a human technician.
  • If a fact reaches a state where it becomes a solution (e.g. internet_connection_works becomes a known false), tell the user the solution and the path (facts and rules) that have led to the conclusion

Possible Extensions of the Basic Design

in rough order of complexity, easiest first:

Save the state of the sessions for several weeks, in order to enable the user to return later and continue the session, e.g. after having determined the answer to a hard question. Enable the user to supply modified (corrected) fact answers, especially for facts previously answered with “don’t know”, or in cases of “a second look has revealed that things actually are different”.

Specify a preset probability for facts as an additional criterion for choosing them, e.g. “a lot of people forgot to change their account settings when we switched servers” would increase the preset probability of account_settings_outdated.

Specify an “easiness to find out” for facts. Facts that are easier to find out (for the end-user) will be asked first.

Multiple possible solutions: if a fact is not a definite solution, but only a possible one, don’t terminate, but continue investigating.

Use fuzzy logic for fact values (values 0…1) instead of Boolean logic (false or true, nothing else).

Specify a probability for rules, e.g. “if (100% a and 100% b) then there is an 80% probability of c”.

Many people want some kind of social networking, but don’t like the (non-)privacy style of Facebook.

There is an alternative being developed: Diaspora. I have heard of it, but when a friend told me his Diaspora address, I had a hard time getting started, so I’ll try to share some useful links:

If you want to join, you’ll either need an invitation or a pod (roughly equivalent to a server) that’ll accept users without invitation. One of those is diasp.org.

They say, it’s not yet ready for the masses. I can confirm this, because there are still a lot of server errors.

Because I wanted to document a few things about Android apps, I was looking for an app to take screenshots. Unfortunately, a search in the market revealed, that the few screenshot apps that exist, all require you to root you phone. I’m not planning to do this on my HTC Desire, because it would void the warranty and might even render the device useless.

A few days ago, I had to plan a real world project (arranging a new bank account for a small local church). The number of steps (16 tasks, 24 links) is high enough, that a dependency aware tool is helpful. So I searched the Android Market for a project management app that could handle dependencies and display them in a Gantt-diagram.

I ended up trying Projektplan Free (home page: http://www.thorstensapps.de, German language only). It took a while until I understood the modal user interface, but then it became really useable, so I could enter the tasks and dependencies as fast as I could plan them. By carefully adjusting the times needed (taking “banks are closed during nights and weekends” into account), I even got a rough estimate of the duration of the project.

Projektplan Free is missing some features that may be important to business users: resources and calendars. The display screens are there, but I found no way to add data.

It displays ads, but only on the list of all projects, not on the gantt-list of tasks within a project. That’s a place where I can tolerate them.

Summary: Projektplan Free is good for visualizing dependencies in small projects, but not good enough for professional use. Pros need Desktop tools like GanttProject or OpenProj – or web tools like Gantter.

Besides my Debian Linux Desktop at home, I’m operating an encrypted portable Ubuntu Linux on an 8 GB USB stick. When Ubuntu 11.10 came out, I ran the usual upgrade on it.

The process downloaded more than 900 MB (23 minutes on a 6000 kbps home DSL line), the upgrade took almost three hours (cheap USB sticks are slow when being written to), but there were no flaws in the process. The system was even perfectly bootable after the upgrade – a lot better than a year or so ago, when some change in /etc/fstab broke the encrypted root mount.

But when I started logging in, I was disappointed to have lost my Gnome Desktop. Just before I started to (grudgingly) accept the loss, I got the idea of searching the Ubuntu Software Center for packages containing “gnome” in their name. The first (most relevant) match was “gnome”, the desktop environment. I installed that (took more than ten minutes, but it’s a big piece of software and USB sticks are slow when being written to) and after the reboot, there was a gear wheel next to the password field. Clicking on that gear wheel opened a menu with half a dozen choices, including “Gnome without effects”. I chose that and got the Gnome desktop.

From a local IT shop (LWM Marburg) I got some old USB sticks. Before using them for important data, I wanted to make sure, they really store the data written to them. So I set out and looked for testing software, preferably running on Linux. It’s surprisingly hard to find.

The classic piece of testing software seems to be h2testw, for Windows, created by the German publishing house Heise. It expects a formatted stick. Testing is done by writing as many huge files (1 GB each) as will fit and then read them to check whether they contain the data that was written. This won’t test every corner, but it will detect fakes (having less capacity than advertised) and it will run without administrator rights.

On http://web.appstorm.net/how-to/simplenote-the-power-of-plain-text/ I read about simplenote. The description looked interesting enough to make me check how it compares to catch.com, my current favorite, so I signed up for a free account on simplenoteapp.com. Their product seems to run on https://simple-note.appspot.com/ .

I ended up comparing a bunch of Simplenote clients for Android with catch.com. Because I don’t have permanent network connectivity (e.g. not in speeding trains in rural areas or inside concrete buildings), I put emphasis on clients capable of offline operation with occasional synchronization.

  • AndroNoter: lean and mean, nice widget, but no tagging support
  • JadeNote: tagging available, but no widget.
  • All other clients have ads, which I just can’t stand in an app that’s the core of my self-organization.

No client comes even close to catch.com, so I’ll stick with that.

After having decided to more regularly publish blog posts, I started looking for a method of collecting ideas and editing drafts on my Android smartphone.

Standard text editors won’t do it for me, because rearranging portions of the text (sentences, paragraphs) feels so clumsy and error prone. I consider it very hard to precisely select a certain range of text on Android. I’m still on 2.2 (“Froyo”), because HTC didn’t yet publish the update to 2.3 for my HTC Desire, bought in late June of 2010.

So I’m looking for an Android app that can manage a bunch of text fragments (thoughts, “items”), rearrange them in a manually selected order and then somehow move that sequence of words into a draft post on wordpress.com.

First Round

I searched the Android Market for a number of words (mind map, subnotes, note tree, subtasks etc.) and found quite a number of candidates. I did include ToDo managers, because they also tend to cater for ordering ideas.

Trying them briefly resulted in these findings, in the order of test:

  • Thinking Space (the mind map classic on Android): powerful arrangements. Needs some learning, but feels quite good then. Not quite ideal for quick notes. Export only as mind map file, so it requires a full PC to copy into a blog post. Admitted to second round.
  • JetNote: no recognisable drag/drop, deinstall
  • MindMapMemo: rearranging won’t readjust other nodes. Nice tool but not for quick arrangeable notes, deinstall
  • ListMaster: ads, to-do oriented, separate title and detail, multiple lists, drag and drop of notes within the list. Admitted to second round.
  • Extensive Notes: no manual sort. Deinstall.
  • Mobisle Notes: lists can be reordered, not items within a list. No export. Deinstall.
  • One Line Todo: ads are dangerously close to the input area. Todo only,  Nice drag & drop of to-dos within one list, but every item (line) absolutely needs date & time. Deinstall.
  • Noodles Todo List: beautifully simple UI, but absolutely no way to export, except copy & paste item by item. Barely admitted to second round.
  • TaskList Todo List: to-do oriented. Slightly slow UI, not faster than Thinking space. Export into XML only. Deinstall
  • LiveList Checklist: great UI, very fast, good manual sort, but no export. Even the web site won’t show the task details.
  • PalmNote: no ads, user definable categories, manual sort order of notes available. Tries to emulate the feel of the note app of good old Palm OS. Export to SD manually, xml only. Admitted to second round.
  • GetItDone Task List: aims high, full GTD, but no export, can’t terminate program. Deinstall.
  • QuickTodo: clumsy, almost buggy UI, no readable export. Deinstall.

The apps that seemed worth a second look got into the

Second Round

All apps that made it though here have sub-items and manual sortability as pre-checked properties.

In this round I’m checking on

  • Visibility of details
  • Ease of entering new items (thoughts)
  • Ease of modifying existing items
  • Ease of rearranging thoughts
  • Ease of exporting thoughts to a WordPress draft post.

Thinking Space

The mind map classic on Android. As a mind map app, it enables powerful arrangements. Needs learning, but quite good then. Not quite ideal for quick notes. Export only as mind map file, so it requires a full PC to copy into a blog post.

  • Details are visible if the nodes are expanded, very flexible, very good.
  • Entering new items: focus (tap) on parent, tap + icon, type text, finish with enter. Parent remains focused. Nice easy.
  • Modifying existing items: double tap item, edit, enter. Nice easy.
  • Rearranging items: tap star icon to enable gesture input, mark item to be moved, swipe curve gesture. This also moves subitems. Cut & paste for changing levels also available. A bit complex but nice flexible.
  • Export to WordPress draft: for each item separately: double tap item, long tap text, copy. Does not copy subitems.
    Alternatively through desktop Freemind and ODT export (would capture entire mind map).

Live List Checklist

Very fast UI, but separate title and description. No useable export, except copy & paste (which may be acceptable).

  • Visibility of details: title & first line only, requires long click to see full detail
  • Entering new items:
    title only: tap on entry field, type, tap “+” icon.
    Title with detail: long tap “+” icon, tap title field, type, tap detail field, type, tap save button. A bit complex.
  • Modifying existing items: long tap item, tap title or detail field, edit, tap save.
  • Rearrange items: Menu, sort/manual, then drag & drop.
  • Export to WordPress: for each item separately: long tap item, long tap title, copy, paste, long tap detail, copy, paste.

ListMaster

Ads, to-do oriented, separate title and detail, multiple lists, drag and drop of notes within the list. Too slow, moved out within the second round.

Noodles Todo List

Beautifully simple, fast UI, title and details are in a common field (which I consider good) but absolutely no way to export, except copy & paste item by item (which may be acceptable).

  • Visibility of details: title plus first 35 characters of detail. Requires long click to see full detail.
  • Entering new items: tap empty field, type title, enter, type details, tap + icon. Nice easy.
  • Modifying existing items: long tap item, tap small text field, edit, tap refresh icon.
  • Rearrange items: direct drag & drop.
  • Export to WordPress: per item: long press item, long press text area, copy, paste

PalmNote

No ads, user definable categories, manual sort order of notes available. Export to SD manually, xml only. Interaction required to see details.

  • Visibility of details: title only, requires click to see details.
  • Entering new items: tap “new”, tap huge text field, type title, enter, type  detail, tap “done”
  • Modifying existing items: tap item, tap large text area, edit, tap “done”
  • Rearranging items: direct drag & drop
  • Export to WordPress: tap item, long tap text area, copy. Or export to xml and fiddle around with the resulting file.

Final Decision

After having tried all these apps, my preference for collecting and arranging ideas on Android is Thinking Space, because the arranging possibilities are by far the best.

Unparalleled switchable visibility of details.

Entering and modifying items is a bit slow, but with a bit of learning it should be as fast as the thoughts are flowing.

Because Thinking Space is capable of storing the results in Freemind format on the SD chip, it is one of the few products that are capable of exporting all items in one single go, although that requires the help of a notebook/desktop PC running Freemind.

For almost a year now I’m using catch.com for taking quick notes. It’s available on the web (everything https by default) and as an Android app (slightly more functions than on the web; didn’t check other platforms).

It is geared towards being really quick when taking notes, jotting down that quickly fading thought. There is a widget for Android, reducing the effort to just one single click (get the focus on the text widget).

A note can be assigned multiple tags, useable for comfortable filtering, both on the web and on the Android app. The Android app can also assign a reminder (alarm) date/time to a note.

The Android app can reliably work offline and sync to the cloud later, when connectivity comes back.

In my view, catch.com is a great system for taking notes, if you can live with the privacy limitations of a cloud service.

A simple feature, but really useful if you run a Drupal website: in admin/reports/updates/settings you can enter a list of email addresses. Whenever the internal mechanism of Drupal learns about an available update for one on the components you run, you’ll get an email. This is better than subscribing to mailing list, because a mailing list would notify you about hundreds of extensions you don’t run.

Follow

Get every new post delivered to your Inbox.