Writing a better alternative to jQuery Autocomplete
You should strongly consider using a JS templating language such as Handlebars.js when rendering the interface.

  // Add the group if it doesn't exist
  var group = callbacks.getGroup(result);
  if ($.type(group) == 'string' &amp;&amp; !groups[group]) {
    var $groupHeading = $('&lt;li /&gt;').addClass('group')
      .append($('&lt;h3 /&gt;').html(group))
      .appendTo($results);
    groups[group] = $groupHeading;
  }

  var $result = $('&lt;li /&gt;').addClass('result')
    .append(output)
    .data('result', result) // Store the result object on this DOM element
    .addClass(result.addClass);


You are doing enough dom manipulation to warrant its use (above is just one part of your code). Furthermore, templates will help separate presentation logic from your business logic which at the moment is quite tangled.