<PAGE>
                                                                    EXHIBIT 10.4



                                   RETEK INC.
                           CHANGE IN CONTROL AGREEMENT

               This Agreement, dated as of March 14, 2002 (the "AGREEMENT"), is
entered into between Retek Inc., a corporation organized under the laws of the
State of Delaware, and Peter Espinosa (the "EXECUTIVE"). Capitalized terms that
are not otherwise defined in the context in which they first appear are defined
in Section 2 of this Agreement.

               WHEREAS, the Board of Directors of Retek Inc. (the "BOARD")
recognizes that the possibility of a Change in Control exists and that the
threat or the occurrence of a Change in Control can result in significant
distractions to its key management personnel because of the uncertainties
inherent in such a situation;

               WHEREAS, the Board has determined that it is essential and in the
best interest of the Company and its stockholders to retain the services of the
Executive in the event of a threat or occurrence of a Change in Control and to
ensure the Executive's continued dedication and efforts in such event without
undue concern for the Executive's personal, financial and employment security;
and

               WHEREAS, in order to induce the Executive to remain in the employ
of the Company, particularly in the event of a threat or the occurrence of a
Change in Control, the Company desires to enter into this Agreement with the
Executive to provide the Executive with certain benefits in connection with a
Change in Control; and

               NOW, THEREFORE, in consideration of the respective agreements of
the parties contained herein, it is agreed as follows:

        1. TERM OF AGREEMENT. This Agreement shall commence as of March 14, 2002
(the "EFFECTIVE DATE") and shall continue in effect until the earlier of: (a)
the seventh anniversary of the Effective Date in the event that a Potential
Change in Control Period has not commenced on or prior to such anniversary; (b)
the date the Executive's employment is terminated by the Company for Cause or by
the Executive other than for Good Reason; (c) in the event that a Potential
Change in Control Period commencing on or prior to the seventh anniversary of
the Effective Date culminates in a Change in Control, the end of the Consulting
Period, provided that the Company has paid to the Executive all amounts due to
him or her under the Agreement; (d) the Executive's death prior to a Potential
Change in Control Period; or (e) in the event that one or more Potential Change
in Control Periods commence on or prior to the seventh anniversary of the
Effective Date and a Change in Control does not occur, the later of (i) the
seventh anniversary of the Effective Date if no Potential Change in Control
Period is effective as of such date or (ii) the date the last Potential Change
in Control Period commencing on or prior to the seventh anniversary of the
Effective Date ends (the "TERM").

<PAGE>

        2. DEFINITIONS.

               a. CAUSE. For purposes of this Agreement, "CAUSE" shall mean the
Executive's (i) conviction of a felony (from which no further appeals have been
or can be taken), or (ii) gross misconduct as an employee of the Company that is
materially injurious to the financial status or reputation of the Company. For
purposes of this Section 2(a), no act or failure to act on the Executive's part
shall be deemed to be a termination for Cause if done, or omitted to be done, in
good faith, and with the reasonable belief that the action or omission was in
the best interests of the Company.

               b. CHANGE IN CONTROL. For purposes of this Agreement, a "CHANGE
IN CONTROL" shall mean any of the following events:

               (i) a dissolution or liquidation of the Company;

               (ii) a merger or consolidation in which the Company is not the
        surviving corporation (other than a merger or consolidation with a
        wholly-owned subsidiary, a reincorporation of the Company in a different
        jurisdiction, or other transaction in which there is no substantial
        change in the stockholders of the Company or their relative stock
        holdings);

               (iii) a merger in which the Company is the surviving corporation
        but after which the stockholders of the Company (other than any
        stockholder which merges (or which owns or controls another corporation
        which merges) with the Company in such merger) cease to own their shares
        or other equity interests in the Company;

               (iv) the sale of all or substantially all of the assets of the
        Company; or

               (v) the acquisition, sale or transfer of more than 50% of the
        outstanding common stock of the Company by tender offer or similar
        transaction.

               c. CHANGE IN CONTROL DATE. For purposes of this Agreement, the
"CHANGE IN CONTROL DATE" shall mean the date of the consummation of a Change in
Control.

               d. CODE. For purposes of this Agreement, the "CODE" shall mean
the Internal Revenue Code of 1986, as amended, and the regulations promulgated
there under.

               e. COMPANY. For purposes of this Agreement, the "COMPANY" shall
mean Retek Inc., a corporation organized under the laws of the State of
Delaware, and shall include the "Successors and Assigns" of Retek Inc. (as such
term is hereinafter defined).

               f. CONSULTING PERIOD. For purposes of this Agreement, the
"CONSULTING PERIOD" shall mean the period beginning on the Change in Control
Date and continuing until the second anniversary of such date.

               g. DISABILITY. For purposes of this Agreement, "DISABILITY" shall
mean a physical or mental infirmity which impairs the Executive's ability to
substantially perform the Executive's duties with the Company for one hundred
eighty (180) days or more during any twelve



                                       2
<PAGE>

(12) month period and the Executive has not returned to full time employment
prior to the Employment Termination Date.

               h. EQUITY PLAN. For purposes of this Agreement, the "EQUITY PLAN"
shall mean the Retek Inc. 1999 Equity Incentive Plan, as amended from time to
time, and any successor plan.

               i. GOOD REASON. For purposes of this Agreement, "GOOD REASON"
shall mean the occurrence of any of the events or conditions described in
subsections (i) through (vi) below; PROVIDED, HOWEVER, that the Executive gives
the Company thirty (30) days' written notice of his or her intent to resign for
Good Reason (during which time the Company will have an opportunity to correct
the condition constituting "Good Reason"):

               (i) The Executive's good faith determination that any of the
        following has occurred:

                      (1) a material change in the Executive's status, title,
               position or responsibilities which represents a material and
               adverse change from the Executive's status, title, position or
               responsibilities as in effect immediately prior to such change;

                      (2) the assignment to the Executive of any duties or
               responsibilities which are substantially inconsistent with the
               Executive's responsibilities as in effect immediately prior to
               such assignment; or

                      (3) any removal of the Executive from or failure to
               reappoint or reelect the Executive to any of such offices or
               positions, except in connection with the termination of the
               Executive's employment for Disability, Cause, as a result of the
               Executive's death, or by the Executive other than for Good
               Reason;

               (ii) a reduction in the Executive's base salary;

               (iii) the relocation by the Company of the Executive's principal
        workplace to a location that is more than 50 miles from the location of
        such principal workplace as of the Effective Date;

               (iv) a material reduction by the Company in the kind or level of
        employee benefits (other than salary) to which the Executive is
        entitled;

               (v) any material breach by the Company of any provision of this
        Agreement or any employment agreement between the Company and the
        Executive; or

               (vi) the failure of the Company to obtain an agreement from any
        Successors and Assigns to assume and agree to perform this Agreement, as
        contemplated in Section 8 hereof.

               j. INVOLUNTARY TERMINATION. For purposes of this Agreement, an
"INVOLUNTARY TERMINATION" shall mean the termination of Executive's employment
with the Company either (i) by the Company due to the Executive's Disability,
(ii) by the Company for reasons other than for Cause, (iii) by the Executive for
Good Reason or (iv) as a consequence of the



                                       3
<PAGE>

Executive's death.

               k. POTENTIAL CHANGE IN CONTROL PERIOD. For purposes of this
Agreement, "POTENTIAL CHANGE IN CONTROL PERIOD" means the period beginning on
the date of execution of an agreement with respect to a transaction the
consummation of which would constitute or result in a Change in Control, and
ending on either the date immediately following the Change in Control Date or
the date on which such agreement is terminated or the transaction contemplated
therein otherwise is abandoned; PROVIDED, HOWEVER, any Potential Change in
Control Period must commence prior to the seventh anniversary of the Effective
Date. In the event that any Potential Change in Control Period does not result
in a Change in Control, a subsequent Potential Change in Control may occur
during the Term.

               l. SUCCESSORS AND ASSIGNS. For purposes of this Agreement,
"SUCCESSORS AND ASSIGNS" shall mean either a successor corporation or entity or
a corporation or other entity acquiring all or substantially all of the assets
and business of the Company (including this Agreement) whether by operation of
law or otherwise.

               m. EMPLOYMENT TERMINATION DATE. For purposes of this Agreement,
"EMPLOYMENT TERMINATION DATE" shall mean the date of the Executive's Involuntary
Termination.

        3. CHANGE IN CONTROL BENEFITS. The parties hereto acknowledge and agree
that the compensation and benefits described in Sections 3(a) through 3(c) are
subject to the provisions of Section 3(f). The Executive further acknowledges
and agrees that any stock options the Executive holds as of the Change in
Control Date that are intended to be "incentive stock options," as such term is
defined in Section 422 of the Code shall automatically convert to nonqualified
stock options as of the Change in Control Date. Unless the Executive becomes
deceased prior to the time he or she is able to execute the waiver and release,
the Executive's entitlement to the payments and benefits described in this
Section 3 is contingent upon execution by the Executive of a valid and
enforceable mutual waiver and release of claims in substantially the form set
forth at Exhibit A hereto (the "WAIVER AND RELEASE"). The Company hereby agrees
that on or before the Change in Control Date, and as soon as practicable after
the Executive's Involuntary Termination prior to a Change in Control Date, it
shall sign and deliver the Waiver and Release to the Executive.

               a. CHANGE IN CONTROL WHILE EXECUTIVE IS AN EMPLOYEE. If, during
the Term, a Change in Control occurs and the Executive is employed by the
Company on the Change in Control Date, the Executive shall be entitled to the
following compensation and benefits:

               (i) Immediately prior to the Change in Control Date, all stock
        options exercisable for Company stock held by the Executive shall become
        fully vested and exercisable.

               (ii) As of the Change in Control Date, the Executive's employment
        with the Company shall terminate and the Executive shall become, as of
        such date, a consultant for the Company. The Executive shall continue to
        serve as a consultant of the Company until the end of the Consulting
        Period. During the Consulting Period, the Executive shall have the
        duties and responsibilities set forth in Section 4 below and such other
        duties and responsibilities as may otherwise be agreed by the Executive.
        The parties hereto



                                       4
<PAGE>

        acknowledge and agree that the Executive shall continue in the service
        of the Company during the Consulting Period for purposes of any
        unexercised stock options held by the Executive as of the Change in
        Control Date and such stock options shall remain exercisable throughout
        the Consulting Period in accordance with the terms of the Equity Plan.

               (iii) Subject to execution by the Executive of the Waiver and
        Release, as soon as practicable after the Change in Control Date, but in
        no event more than ten days after the Executive has signed (and, if
        applicable, not revoked) the Waiver and Release, the Company shall pay
        the Executive:

                      (A) a lump sum cash amount equal to his or her then
                      effective base salary multiplied by two (2); plus

                      (B) a lump sum cash amount equal to his or her then
                      effective target annual bonus multiplied by two (2).

        The Company hereby agrees that it shall execute the waiver and release
        of claims substantially in the form set forth as Exhibit A as soon as
        practicable after the Change in Control Date.

               (iv) During the Consulting Period, the Executive shall continue
        to participate in all benefit plans (to the extent possible under the
        terms of such plans) and to receive all fringe benefits from the Company
        to which he or she was entitled on the Change in Control Date, PROVIDED
        that if the Executive obtains subsequent employment and such employment
        provides the Executive substantially similar or more generous benefits,
        the Company's obligations in this regard shall cease on the date that
        the Executive becomes entitled to receive such benefits from his or her
        subsequent employer.

               (v) In the event that the Executive dies during the Consulting
        Period, the Executive's estate shall be entitled to the benefits set
        forth in this Section 3(a), to the extent possible under the terms of
        each applicable benefit plan, for the remainder of the Consulting
        Period, including, without limitation, the continued exerciseability of
        any stock options held by the Executive prior to this death. For
        purposes of this Agreement, any reference to the Executive shall be
        deemed to refer to the Executive's estate, as applicable, after the
        Executive's death.

               (vi) Except as expressly set forth in this Section 3(a) and
        Section 3(e) or in connection with the services the Executive performs
        in compliance with his or her obligations under Section 4 below, neither
        the Executive nor the Executive's estate shall be entitled to any
        compensation or benefits from the Company during the Consulting Period.

               b. DURING THE ASSESSMENT PERIOD OR THE POTENTIAL CHANGE IN
CONTROL PERIOD--OTHER THAN DEATH.

               (i) If, at any time after the Effective Date, the Executive
        suffers an Involuntary Termination (other than an Involuntary
        Termination due to the Executive's death), during the six-month period
        after such termination (the "ASSESSMENT PERIOD") the Executive shall be



                                       5
<PAGE>

        deemed to be on an unpaid approved leave of absence, including, without
        limitation, for purposes of the Equity Plan. During the Assessment
        Period, the vesting of the Executive's stock options under the Equity
        Plan shall be suspended. If the Compensation Committee of the Board (the
        "COMMITTEE"), in its sole discretion, reinstates the Executive's
        employment with the Company during the Assessment Period, the
        Executive's stock options will be vested, as of the date of rehire, in
        the same manner as if such vesting had not been suspended during the
        Assessment Period. If a Potential Change in Control Period does not
        begin during the Assessment Period (as described in Section 3(b)(ii)
        below) and the Executive is not rehired by the Company on or before the
        end of the Assessment Period, the Executive's service with the Company
        shall be terminated for all purposes, including for purposes of the
        Equity Plan, on the last day of the Assessment Period. If, at any time
        after the Effective Date, the Executive suffers an Involuntary
        Termination (other than an Involuntary Termination due to the
        Executive's death), either (A) during a Potential Change in Control
        Period or (B) during an Assessment Period which ends with the
        commencement of a Potential Change in Control Period, the Executive
        shall be deemed to be on an unpaid approved leave of absence, including,
        without limitation, for purposes of the Equity Plan, beginning on the
        Employment Termination Date and continuing until the end of the
        Potential Change in Control Period.

               (ii) In the event that a Change in Control occurs in connection
        with a Potential Change in Control Period during which the Executive is
        on an approved leave of absence as described above, the Executive shall
        be entitled to the payments and benefits described in this Section
        3(b)(ii):

                      (A) Immediately prior to the Change in Control Date, all
               stock options exercisable for Company stock held by the Executive
               shall become fully vested and exercisable.

                      (B) As of the Change in Control Date, the Executive's
               approved leave of absence and employment with the Company shall
               terminate and the Executive shall become, as of such date, a
               consultant for the Company. The Executive shall continue to serve
               as a consultant of the Company until the end of the Consulting
               Period. During the Consulting Period, the Executive shall have
               the duties and responsibilities set forth in Section 4 below and
               such other duties and responsibilities as may otherwise be agreed
               by the Executive. The parties hereto acknowledge and agree that
               the Executive shall continue in the service of the Company during
               the Consulting Period for purposes of any unexercised stock
               options held by the Executive as of the Change in Control Date
               and such stock options shall remain exercisable throughout the
               Consulting Period in accordance with the terms of the Equity
               Plan.

                      (C) Subject to execution by the Executive of a mutual
               waiver and release of claims in substantially the form set forth
               at Exhibit A hereto, as soon as practicable after the Change in
               Control Date, but in no event more than ten days after the
               Executive has signed (and, if applicable, not revoked) the waiver
               and release of claims, the Company shall pay the Executive:



                                       6
<PAGE>

                      (I)    a lump sum cash amount equal to his or her base
                             salary as in effect on the Employment Termination
                             Date multiplied by two (2); plus

                      (II)   a lump sum cash amount equal to his or her target
                             annual bonus as in effect on the Employment
                             Termination Date multiplied by two (2).

               (iii) In the event that any amounts become payable to the
        Executive's beneficiary or estate under this Section 3(b) as a
        consequence of the Executive's death during the Potential Change in
        Control Period or the Consulting Period, all pertinent references in
        this Agreement to the Executive shall be deemed to refer to the
        Executive's beneficiary or estate, as applicable. The Company hereby
        agrees that it shall execute the waiver and release of claims
        substantially in the form set forth as Exhibit A as soon as practicable
        after the Change in Control Date.

               c. DEATH DURING A POTENTIAL CHANGE IN CONTROL PERIOD.

               (i) If the Executive dies during a Potential Change in Control
        Period, as of the time of the Executive's death all his or her
        outstanding stock options shall become immediately vested (the portion
        of the Executive's stock options that becomes accelerated upon his or
        her death shall hereinafter be referred to as the "ACCELERATED
        OPTIONS"); PROVIDED, HOWEVER, the Accelerated Options shall not be
        exercisable until immediately prior to the occurrence of a Change in
        Control Date in connection with such Potential Change in Control Period
        exercisable; and PROVIDED FURTHER, HOWEVER, that in the event that for
        any reason the Change in Control Date does not occur the status of the
        Executive's Accelerated Options shall revert to their unvested condition
        as in effect prior to such acceleration;

               (ii) In the event that the Potential Change in Control Period
        results in a Change in Control, the Executive's beneficiary or estate
        shall be entitled to the benefits described in this Section 3(c)(ii).

                      (A) Immediately prior to the Change in Control Date, the
               Accelerated Options shall become exercisable and shall remain
               exercisable until the second anniversary of the Change in Control
               Date.

                      (B) As soon as practicable after the Change in Control
               Date, the Company shall pay the Executive's beneficiary or
               estate:

                      (I)    a lump sum cash amount equal to the Executive's
                             base salary as in effect on the date of death
                             multiplied by two (2); plus

                      (II)   a lump sum cash amount equal to the Executive's
                             target annual bonus as in effect on date of death
                             multiplied by two (2).

               d. NO MITIGATION. The Executive shall not be required to mitigate
the amount of any payment provided for in this Agreement by seeking other
employment or otherwise, and no such payment shall be offset or reduced by the
amount of any compensation or benefits



                                       7
<PAGE>

provided to the Executive in any subsequent employment, PROVIDED that if the
Executive obtains subsequent employment and such employment provides the
Executive substantially similar or more generous fringe benefits, the Company's
obligations in this regard shall cease on the date that the Executive becomes
entitled to receive such benefits from his or her subsequent employer.

               e. NO LIMITATION ON ADDITIONAL BENEFITS. Except as expressly
provided in Section 3(f) below, the compensation and benefits provided for in
this Section 3 shall not limit any additional benefits to which the Executive
may be entitled (except pursuant to any severance or termination policies,
plans, programs or practices). Nothing in this Agreement shall prevent or limit
Executive's continuing or future participation in any benefit, bonus, incentive,
or other plan or program provided by the Company and for which the Executive may
qualify, nor shall anything herein limit or reduce such rights as the Executive
may have under any other agreements with the Company.

               f. NON-US EMPLOYEES. If the Executive is subject to the laws of a
jurisdiction other than the United States of America and such jurisdiction
provides the Executive with any statutory rights to compensation or benefits in
the event of his or her Involuntary Termination or upon a Change in Control, the
Executive or the Executive's estate, as the case may be, shall be entitled to
receive the compensation and benefits set forth in this Agreement only to the
extent that such compensation and benefits exceed what the Executive is
otherwise entitled to receive under such statutes. The Company hereby agrees to
use its best efforts to equitably determine the benefits that the Executive
shall be entitled to receive under this Agreement in the event that the
Executive is subject to this Section 3(f).

        4. CONSULTING AND OTHER SERVICES TO THE COMPANY.

               a. BRIEF CONSULTATIONS. During the Consulting Period, the Company
may contact the Executive for brief consultations by telephone or email, not to
exceed one hour per month in the aggregate.

               b. OTHER CONSULTING SERVICES. During the first six months of the
Consulting Period, the Company, in its sole discretion, may ask the Executive to
continue working for the Company in such capacity as the Company shall
determine. In consideration for any such services, the Company shall pay the
Executive a consulting fee that is equal to a prorated portion of the
Executive's salary and target bonus as in effect immediately prior to the Change
in Control Date or the Executive's Involuntary Termination, as applicable.

        5. TAX GROSS-UP PAYMENTS.

               a. ENTITLEMENT. In the event that any of the payments or benefits
due to the Executive (including, without limitation, any accelerated vesting of
equity-based awards) provided for in this Agreement or any other payments or
benefits due to the Executive (individually, a "PAYMENT", and collectively,
"PAYMENTS") (i) constitute "parachute payments" within the meaning of Section
280G of the Code, and (ii) but for this Section, would be subject to the excise
tax imposed by Section 4999 of the Code (the "EXCISE TAX"), then the Executive
shall receive a full gross-up ("TAX GROSS-UP") for any and all Excise Taxes
imposed.



                                       8
<PAGE>

               b. DETERMINATION OF AMOUNT. An initial determination as to
whether the Excise Tax will be imposed, the amount of the Excise Tax and the
calculated Tax Gross-up shall be made, at the Company's expense, by the
accounting firm that is the Company's independent accounting firm as of the date
of the Change in Control (the "ACCOUNTING FIRM"). The Accounting Firm shall
provide its determination (the "DETERMINATION"), together with detailed
supporting calculations and documentation, to the Company and the Executive
within ten (10) days of the Employment Termination Date, if applicable, or such
other time as requested by the Company or by the Executive (provided the
Executive reasonably believes that any of the Payments may be subject to the
Excise Tax) and, if the Accounting Firm determines that no Excise Tax is payable
by the Executive with respect to a Payment or Payments, it shall furnish the
Executive with an opinion reasonably acceptable to the Executive that no Excise
Tax will be imposed with respect to any such Payment or Payments. Within ten
(10) days of the delivery of the Determination to the Executive, the Executive
shall have the right to dispute the Determination (the "DISPUTE"). If there is
no Dispute, the Determination shall be binding, final and conclusive upon the
Company and the Executive.

               c. OVERPAYMENTS AND UNDERPAYMENTS. As a result of uncertainty in
the application of Section 4999 of the Code at the time of the initial
determination by the Accounting Firm hereunder, it is possible that Tax Gross-Up
payments not made by the Company should have been made ("UNDERPAYMENT"), or that
Tax Gross-Up payments will have been made by the Company which should not have
been made ("OVERPAYMENTS"). In either such event, the Accounting Firm shall
determine the amount of the Underpayment or Overpayment that has occurred. In
the case of an Underpayment, the amount of such Underpayment shall be promptly
paid by the Company to or for the benefit of the Executive. In the case of an
Overpayment, the Executive shall, at the direction and expense of the Company,
take such steps as are reasonably necessary (including the filing of returns and
claims for refund), follow reasonable instructions from, and procedures
established by, the Company, and otherwise reasonably cooperate with the Company
to correct such Overpayment.

        6. RESTRICTIVE COVENANTS.

               a. NON-SOLICITATION. During the period commencing on the date of
this Agreement and continuing until the earlier of the first anniversary of the
Employment Termination Date or the first anniversary of the Change in Control
Date, the Executive shall not directly or indirectly, personally or through
others, solicit or attempt to solicit (on the Executive's own behalf or on
behalf of any other person or entity) either (i) the employment of any employee
of the Company or any of the Company's affiliates or (ii) the business of any
customer of the Company or any of the Company's affiliates with whom the
Executive had contact during his or her employment.

               b. NON-DISCLOSURE. The Executive recognizes that the services
performed by the Executive on behalf of the Company are special, unique and
extraordinary in that, by reason of his or her employment hereunder, he or she
may acquire confidential information and trade secrets concerning the operation
of the Company, the use or disclosure of which could cause the Company
substantial losses and damages which could not be readily calculated and for
which no remedy at law would be adequate. Accordingly, the Executive covenants
and agrees with the Company that he or she will not at any time, except in
performance of his or her obligations to the Company or with the prior written
consent of the Company, directly or indirectly, either disclose to any person,
or use for his or her personal benefit, any secret or confidential information
that the



                                       9
<PAGE>

Executive may learn or has learned by reason of the Executive's association with
the Company. The term "CONFIDENTIAL INFORMATION" means any information not
previously disclosed or otherwise available to the public or to the trade with
respect to the Company's products, facilities and methods, trade secrets and
other intellectual property, systems, procedures, manuals, confidential reports,
product price lists, customer lists, financial information, business plans,
prospects or opportunities.

        7. EMPLOYMENT TAXES. All payments made pursuant to this Agreement will
be subject to applicable withholdings of income and employment taxes.

        8. SUCCESSORS; BINDING AGREEMENT. This Agreement shall be binding upon
and shall inure to the benefit of the Company, its Successors and Assigns and
the Company shall require any Successors and Assigns to expressly assume and
agree to perform this Agreement in the same manner and to the same extent that
the Company would be required to perform it if no such succession or assignment
had taken place. Neither this Agreement nor any right or interest hereunder
shall be assignable or transferable by the Executive or the Executive's
beneficiaries or legal representatives, except by will or by the laws of descent
and distribution. This Agreement shall inure to the benefit of and be
enforceable by the Executive's legal personal representative.

        9. NOTICE. For the purposes of this Agreement, notices and all other
communications provided for in the Agreement shall be in writing and shall be
deemed to have been duly given when personally delivered or sent by certified
mail, return receipt requested, postage prepaid, addressed to the respective
addresses last given by each party to the other, provided that all notices to
the Company shall be directed to the attention of the Chairman of the Board with
a copy to the Secretary of the Company. All notices and communications shall be
deemed to have been received on the date of delivery thereof or on the third
business day after the mailing thereof, except that notice of change of address
shall be effective only upon receipt.

        10. NON-EXCLUSIVITY OF RIGHTS. Nothing in this Agreement shall prevent
or limit the Executive's continuing or future participation in any benefit,
bonus, incentive or other plan or program provided by the Company (except for
any severance or termination policies, plans, programs or practices) and for
which the Executive may qualify, nor shall anything herein limit or reduce such
rights as the Executive may have under any other agreements with the Company.
Amounts which are vested benefits or which the Executive is otherwise entitled
to receive under any plan or program of the Company shall be payable in
accordance with such plan or program, except as explicitly modified by this
Agreement.

        11. MISCELLANEOUS. No provision of this Agreement may be modified,
waived or discharged, unless such waiver, modification or discharge is agreed to
in writing and signed by the Executive and the Company. No waiver by either
party hereto at any time of any breach by the other party hereto, or compliance
with, any condition or provision of this Agreement to be performed by such other
party shall be deemed a waiver of similar or dissimilar provisions or conditions
at the same or at any prior or subsequent time. No agreement or representation,
oral or otherwise, express or implied, with respect to the subject matter hereof
have been made by either party which are not expressly set forth in this
Agreement.

        12. GOVERNING LAW. This Agreement shall be governed by and construed and
enforced in accordance with the laws of the State of Delaware without giving
effect to the conflict of law principles thereof.



                                       10
<PAGE>

        13. LEGAL FEES AND EXPENSES. The Company shall pay or reimburse the
Executive on an after-tax basis for all costs and expenses (including, without
limitation, court and arbitrations cost and reasonable legal fees and expenses
which reflect common practice with respect to the matters involved) incurred by
the Executive as a result of any claim, action or proceeding arising out of this
Agreement or the contesting, disputing or enforcing of any provision, right or
obligation under this Agreement, except where it is finally determined that the
Executive's position was entirely without merit and asserted in bad faith.

        14. SEVERABILITY. The provisions of this Agreement shall be deemed
severable and the invalidity or unenforceability of any provision shall not
affect the validity or enforceability of the other provisions hereof.

        15. ENTIRE AGREEMENT. The parties agree that the terms of this Agreement
are intended to be the final expression of their agreement with respect to the
subject matter of this Agreement and may not be contradicted by evidence of any
prior or contemporaneous Agreement, except to the extent that the provisions of
any such agreement have been expressly referred to in this Agreement as having
continued effect. Any and all previous change in control agreements between the
Company and the Executive are null and void and given no effect.

               IN WITNESS WHEREOF, the Company has caused this Agreement to be
executed by its duly authorized officer and the Executive has executed this
Agreement as of the day and year first above written.

                                             RETEK INC.


                                             By:  /S/ STEVEN D. LADWIG
                                                  ------------------------------
                                                  Steven D. Ladwig
                                                  President, CEO Retek Inc


                                             THE EXECUTIVE

                                             /S/ PETER ESPINOSA  6/10/02
                                             -----------------------------------
                                             Peter Espinosa



                                       11
<PAGE>

EXHIBIT A


                      FORM OF WAIVER AND RELEASE OF CLAIMS


                              [COMPANY LETTERHEAD]


                                     [DATE]

[NAME]
[ADDRESS]


Dear [NAME]:

               This letter agreement (the "AGREEMENT") reflects our mutual
agreement concerning the termination of your employment with Retek Inc., a
corporation organized under the laws of [STATE] (the "COMPANY").

               1. [STATE DATE OF TERMINATION--CHANGE IN CONTROL DATE] (the
"TERMINATION DATE").

               2. Consideration. Subject to your execution of this Agreement and
your compliance with its terms and provided that you do not revoke your
acceptance of this Agreement during the Revocation Period described in Section 5
below, the Company agrees to pay and provide you with the payments and benefits
set forth in the change in control agreement between you and the Company dated
[DATE] (the "CIC AGREEMENT"), and in the manner and under the terms set forth in
the CIC Agreement and subject to the terms of the CIC Agreement.

               3. Mutual Release. For purposes of this mutual release, "EMPLOYEE
PARTIES" means, individually and collectively, you, your family members, your
estate, your beneficiaries, your heirs and your assigns and the estate,
beneficiaries, heirs and assigns of each of the foregoing and "COMPANY PARTIES"
means, individually and collectively, the Company, its present, former and
future shareholders, partners, limited partners, affiliates, direct and indirect
parents, subsidiaries, successors, directors, officers, employees, agents,
attorneys, heirs and assigns. The Employee Parties and the Company Parties
together shall hereinafter be referred to as the "RELEASED PARTIES".

               (a) General Waiver and Release. In exchange for the mutual
consideration set forth herein, the receipt and adequacy of which are herein
acknowledged, and intending to be legally bound hereby, the Company, on the one
hand, and you, on the other hand, do hereby release and forever discharge the
Employee Parties and the Company Parties, respectively, from any and all claims,
actions, causes of action, suits, costs, controversies, judgments, decrees,
verdicts, damages, liabilities, attorneys' fees, covenants, contracts, and
agreements that you may have against the Company Parties or the Company may have
against the Employee Parties, or in the future may possess based on events
occurring during the term of your employment with the Company arising out of (i)
your employment relationship with or service as an employee or officer of the
Company or the termination of such relationship or service or (ii) any event,
condition, circumstance or obligation that occurred, existed or arose on or
prior to the date you sign this Agreement, with respect to each other,
including, but not limited to, any claims arising under Title VII of the Civil



                                      A-1
<PAGE>

Rights Act of 1964, the Rehabilitation Act of 1973, the Americans with
Disabilities Act of 1990, the Civil Rights Act of 1866, the Civil Rights Act of
1991, the Employee Retirement Income Security Act of 1974, the Family Medical
Leave Act of 1993, or any other federal or state or local law or any foreign
jurisdiction, whether such claim arises under statute, common law or in equity,
and whether or not any of the Released Parties are presently aware of the
existence of such claim, damage, action or cause of action, suit or demand
(collectively, including claims, actions and causes of action set forth in
Section 3(b) below, the "CLAIMS"). You and the Company also do forever release,
discharge and waive any right you or the Company may have to recover in any
proceeding brought by any federal, state or local agency against the Company
Parties and the Employee Parties, respectively, to enforce any laws. Each of the
parties hereto agrees that the value received as described in this Agreement
shall be in full satisfaction of any and all claims, actions or causes of action
for payment or other benefits of any kind that you may have against the Company
Parties and that the Company may have against the Employee Parties.

               (b) ADEA Release. In further recognition of the above, you hereby
release and forever discharge each of the Company Parties from any and all
claims, actions and causes of action that you may have as of the date you sign
and deliver to the Company this Agreement arising under the federal Age
Discrimination in Employment Act of 1967, as amended, and the applicable rules
and regulations promulgated thereunder ("ADEA").

               (c) No Impact on Obligations Under This Agreement. The releases
contained in this Section 3 do not, are not intended to and shall not be
interpreted to serve as a release or waiver by you or the Company with respect
to the respective rights and obligations set forth in this Agreement.

               (d) No Impact on Indemnification Rights. The releases contained
in this Section 3 do not, are not intended to and shall not be interpreted to
serve as a release or waiver by you with respect to any indemnification rights
you have and such indemnification rights shall not be effected, modified or
extinguished by your execution of this Agreement.

               (e) No Pending Litigation. You hereby represent and agree that
you have not filed, and will not file, any action, complaint, charge, grievance
or arbitration against any Company Party. The Company hereby represents and
agrees that the Company has not filed, and will not file, any action, complaint,
charge, grievance or arbitration against any Employee Party.

               (f) No Right to Commence any Legal Action. You will not commence
or join any legal action, which term includes, without limitation, any demand
for arbitration proceedings and any complaint to any federal, state or local
agency, court or other tribunal, to assert any Claim released by you under
Section 3 against a Company Party. If you commence or join any such legal action
against a Company Party, you will promptly indemnify such Company Party for its
reasonable costs and attorneys' fees incurred in defending such action as well
as any monetary judgment obtained by you against any Company Party in such
action. Similarly, the Company will not commence or join any legal action, which
term includes, without limitation, any demand for arbitration proceedings and
any complaint to any federal, state or local agency, court or other tribunal, to
assert any Claim released by the Company under Section 3 against an Employee
Party. If the Company commences or joins any such legal action against an
Employee Party, the Company will promptly indemnify such Employee Party for its
reasonable costs and attorneys' fees incurred in defending such action as well
as any monetary judgment obtained by the Company against any Employee Party in
such action.



                                      A-2
<PAGE>

               (g) Acknowledgment. By signing this Agreement, you hereby
acknowledge and confirm that you are providing the release and discharge set
forth in this Section 3 in exchange for consideration in addition to anything of
value to which you are already entitled. By signing this Agreement, you hereby
acknowledge and confirm that (i) you are hereby advised in writing by the
Company in connection with your resignation to consult with an attorney of your
choice prior to signing the Agreement and to have such attorney explain to you
the terms of the Agreement, including, without limitation, the terms relating to
your release of Claims arising under ADEA; (ii) you have read the Agreement
carefully and completely and understand each of the terms thereof; and (iii) you
were given not less than twenty-one (21) days to consider the terms of the
Agreement and to consult with an attorney of your choosing with respect thereto,
and that for a period of seven (7) days following your signing of this
Agreement, you have the option to revoke this Agreement in accordance with the
terms set forth in Section 5 below.

               4. Successors. The rights and obligations under this Agreement
shall inure to any and all successors of the Company.

               5. Revocation. You have the right to revoke this Agreement during
the seven-day period commencing immediately following the date you sign and
deliver this Agreement to the Company (the "REVOCATION PERIOD"). The period
shall expire at 5:00 p.m., Eastern [Standard] Time, on the last day of the
seven-day period; PROVIDED, HOWEVER, that if such seventh day is not a business
day, the period shall extend to 5:00 p.m. on the next succeeding business day.
In the event of any such revocation by you, the obligations of the Company under
this Agreement shall terminate and be of no further force and effect as of the
date of such revocation. No such revocation by you shall be effective unless it
is in writing and signed by you and received by a representative of the Company
prior to the expiration of the Revocation Period.

               6. Counterparts. The Agreement may be executed in two or more
counterparts, each of which shall be deemed to be an original but all of which
together will constitute one and the same instrument.

               Your signature on the line below constitutes your agreement with
each provision contained herein.


                                             [COMPANY]


                                             By:
                                                --------------------------------
                                             Name:
                                             Title:

ACCEPTED AND AGREED:


-----------------------------------
[NAME]
Address:
Dated:                , 20
      ----------------    --



                                      A-3