<PAGE>

                                                                    Exhibit 10.5

                         AGREEMENT AND PLAN OF MERGER

     THIS AGREEMENT AND PLAN OF MERGER dated as of January 12, 1999 (this
"Agreement"), is entered into between BLUE MARTINI SOFTWARE, INC., a Delaware
corporation ("Blue Corp.") and BLUE MARTINI LLC, a Delaware limited liability
company ("Blue LLC") (Blue LLC and Blue Corp. are collectively referred to
herein as the "Constituent Entities").

                              W I T N E S S E T H

     WHEREAS, Blue LLC is a limited liability company duly organized and
existing under the laws of the State of Delaware;

     WHEREAS, Blue Corp. is a corporation duly organized and existing under the
laws of the State of Delaware;

     WHEREAS, the Board of Directors of Blue Corp. and the Managers of Blue LLC
deem it advisable and in the best interests of their respective entities and
stockholders or members, as applicable, that Blue LLC be merged with and into
Blue Corp. with Blue Corp. being the Surviving Entity (as defined below); and

     WHEREAS, it is intended that the Merger (as defined below) qualify as a
tax-free transaction within the meaning of Section 351 of the Internal Revenue
Code of 1986, as amended;

     NOW, THEREFORE, in consideration of the premises and the mutual promises
and covenants and subject to the conditions herein set forth, the Constituent
Entities agree as follows:

     1.   Merger.  At the Effective Time of the Merger (hereinafter defined),
Blue LLC shall be merged with and into Blue Corp. in a merger (the "Merger") to
be consummated pursuant to and on the terms and conditions set forth in this
Agreement and in accordance with the laws of the State of Delaware. Blue Corp.
shall be the surviving entity of the Merger (the "Surviving Entity"), and shall
continue its corporate existence as a corporation governed by the laws of the
State of Delaware under the name "Blue Martini Software, Inc." Its principal
office in the State of Delaware is located at 1209 Orange Street, Wilmington,
Delaware.

     2.   Effective Time of the Merger.  The time when the Merger shall become
effective (the "Effective Time of the Merger") shall be at the time and date
when a copy of a Certificate of Merger has been filed with the Secretary of
State of the State of Delaware pursuant to Section 264 of the Delaware General
Corporation Law (the "Delaware Act").

     3.   Certificate of Incorporation and Bylaws.  From and after the Effective
Time of the Merger, the Certificate of Incorporation and Bylaws of Blue Corp.,
as in effect immediately prior to the Effective Time of the Merger, shall be the
Certificate of Incorporation and Bylaws of the Surviving Entity, until changed
or amended as provided herein.

     4.   Directors and Officers.  From and after the Effective Time of the
Merger, the directors on the Board of Directors and officers of Blue Corp. as of
the Effective Time of the

                                       1
<PAGE>

Merger shall continue to serve as the directors on the Board of Directors and
officers of the Surviving Entity, each of whom shall hold office subject to the
provisions of the Delaware Act and the Certificate of Incorporation and Bylaws
of the Surviving Entity from and after the Effective Time of the Merger.

     5.   Treatment of Membership Interests of Blue LLC.  On or after the
Effective Date, each membership interest designated as a Class A Unit of Blue
LLC shall be exchanged for one (1) share of Series A Preferred Stock of Blue
Corp. and shall be so registered on the books and records of the Surviving
Entity or its transfer agents. On or after the Effective Date, each membership
interest designated as a Class B Unit of Blue LLC shall be exchanged for one (1)
share of Common Stock of Blue Corp. and shall be so registered on the books and
records of the Surviving Entity or its transfer agent.

     6.   Effects of the Merger.  At the Effective Time of the Merger:

               (i)    the Constituent Entities shall be merged into a single
entity, which shall be the Surviving Entity;

               (ii)   the separate existence of Blue LLC shall cease;

               (iii)  the Surviving Entity shall have all of the rights,
privileges, immunities and powers and shall be subject to all the duties and
liabilities of a corporation organized under the Delaware Act;

               (iv)   the Surviving Entity shall possess all the rights,
privileges, immunities and franchises, of a public as well as of a private
nature, of each of the Constituent Entities;

               (v)    all property, real, personal and mixed, and all debt due
on whatever account, if any, and all other choses in action, due to each of the
Constituent Entities, shall be taken and deemed to be transferred to and vested
in the Surviving Entity without further act or deed;

               (vi)   title to any real estate, or any interest therein vested
in any of the Constituent Entities shall not revert or be in any way impaired by
reason of the Merger;

               (vii)  the Surviving Entity shall be responsible and liable for
all of the liabilities and obligations of each of the Constituent Entities;

               (viii) any existing claim or pending action or proceeding by or
against any of the Constituent Entities may be prosecuted as if the merger had
not taken place or the Surviving Entity may be substituted in its place, and any
judgment rendered against any of the Constituent Entities may be enforced
against the Surviving Entity; and

               (ix)   neither the rights of creditors nor any liens upon any
property of any of the Constituent Entities shall be impaired by the Merger.

                                       2
<PAGE>

     7.   Termination.

          (a)  Circumstances of Termination.  This Agreement may be terminated
(notwithstanding approval by the members or stockholders of any party hereto):

               (i)  By the mutual consent in writing of the Managers or Board of
Directors of the Constituent Entities hereto prior to the Effective Time of the
Merger; or

               (ii) By the Board of Directors of any Constituent Entity if the
Effective Time of the Merger has not occurred by February 28, 1999.

          (b)  Effect of Termination.  In the event of a termination of this
Agreement pursuant to Section 7(a) hereof, each party shall pay the costs and
expenses incurred by it in connection with this Agreement and no party (or any
of its officers, directors and stockholders, managers or members) shall have any
further liability to any other party for any costs, expenses, damages or loss of
anticipated profits hereunder.

     8.   General Provisions.

          (a)  Further Assurances.  If at any time the Surviving Entity shall
consider or be advised that any further assignment or assurance in law or other
action is necessary or desirable to vest, perfect or confirm, of record or
otherwise, in the Surviving Entity the title to any property or rights of Blue
LLC acquired or to be acquired as a result of the Merger, the proper officers
and directors of Blue LLC and officers and directors of the Surviving Entity,
shall be and they hereby are, severally and fully authorized to execute and
deliver such deeds, assignments and assurances in law and to take such other
action as may be necessary or proper in the name of Blue LLC or the Surviving
Entity and otherwise to carry out the purpose of this Agreement.

          (b)  Notices.  All notices and other communications hereunder shall be
in writing and shall be deemed to have been given if delivered in person or sent
by prepaid first class registered or certified mail, return receipt requested at
the principal executive offices of such person.

          (c)  Entire Agreement.  This Agreement constitutes the entire
agreement between the parties and supersedes and cancels any other agreement,
representation or communication, whether oral or written, between the parties
hereto relating to the transactions contemplated herein or the subject matter
hereof.

          (d)  Headings.  The section and subsection headings in this Agreement
are inserted for convenience only and shall not affect in any way the meaning or
interpretation of this Agreement.

          (e)  Governing Law.  This Agreement shall be governed by and construed
and enforced in accordance with the laws of the State of Delaware.

          (f)  Assignment.  This Agreement shall inure to the benefit of, and be
binding upon, the parties hereto and their successors and assigns; provided,
however, that any assignment

                                       3
<PAGE>

by any party of its rights under this Agreement without the written consent of
the other parties shall be void.

          (g)  Amendment.  This Agreement may not be amended except pursuant to
an instrument in writing signed on behalf of each of the parties hereto.

          (h)  Counterparts.  This Agreement may be executed simultaneously in
two or more counterparts each of which shall be deemed an original, but all of
which together shall constitute one and the same instrument.

          (i)  Tax Consequences.  For federal income purposes, the Merger is
intended to constitute a transaction within the meaning of Section 351 of the
Internal Revenue Code of 1986, as amended.

                                       4
<PAGE>

     IN WITNESS WHEREOF, pursuant to authority duly given by their respective
Board of Directors, the Constituent Entities have caused this Agreement to be
signed in their respective corporate names by their respective corporate
officers, as of the date first above written.


                              BLUE MARTINI SOFTWARE, INC.,
                              a Delaware corporation


                              By:   /s/ Monte Zweben
                                    --------------------------------------
                                    Monte Zweben
                                    President


                              By:   /s/ Eric Jensen
                                 -----------------------------------------
                                    Eric Jensen
                                    Secretary


                              BLUE MARTINI LLC,
                              a Delaware limited liability company


                              By:   /s/ Monte Zweben
                                 -----------------------------------------
                                    Monte Zweben
                                    President


                              By:   /s/ Eric Jensen
                                 -----------------------------------------
                                    Eric Jensen
                                    Secretary

                                       5