<PAGE>   1
                                                                   EXHIBIT 10.20

                                 SELECTICA, INC.




                            STOCK PURCHASE AGREEMENT




                                JANUARY 31, 2000



<PAGE>   2
                                TABLE OF CONTENTS


<TABLE>
<CAPTION>
                                                                                               Page No.
                                                                                               --------
<S>                                                                                            <C>
1.  Purchase and Sale of Stock...............................................................     1
        1.1  Sale and Issuance of Stock......................................................     1
        1.2  The Closing.....................................................................     1

2.  Representations and Warranties of the Company............................................     1
        2.1  Organization and Good Standing..................................................     1
        2.2  Authorization...................................................................     2
        2.3  Valid Issuance of Stock.........................................................     2
        2.4  Title to Property and Assets....................................................     2
        2.5  Compliance with Other Documents.................................................     2
        2.6  Registration Statement..........................................................     2
        2.8  Litigation......................................................................     3
        2.9  Intellectual Property...........................................................     3
        2.10  Financial Statements...........................................................     3
        2.11  Changes........................................................................     3
        2.12  Taxes..........................................................................     3

3.  Representations and Warranties of the Investor...........................................     3
        3.1  Authorization...................................................................     3
        3.2  Investigation...................................................................     4
        3.3  Accredited Investor.............................................................     4
        3.4  Purchase Entirely for Own Account...............................................     4
        3.5  Restricted Securities...........................................................     4

4.  Conditions to the Investor's Obligation at Closing.......................................     4
        4.1  Representations and Warranties..................................................     4
        4.2  Securities Laws.................................................................     4
        4.3  Authorizations..................................................................     4
        4.5  Initial Public Offering of Common Stock.........................................     5

5.  Conditions to the Company's Obligations at Closing.......................................     5
        5.1  Representations and Warranties..................................................     5
        5.2  Securities Laws.................................................................     5
        5.4  Authorizations..................................................................     5
        5.5  Initial Public Offering of Common Stock.........................................     5
        5.6  Payment of Purchase Price.......................................................     5
        5.7  Lock-Up Agreement...............................................................     5

6.  Covenants of the Company and the Investor................................................     5
        6.1  Agreement Not to Transfer.......................................................     5
        6.2  Market Stand-Off................................................................     6
        6.5  Registration of Stock...........................................................     6
</TABLE>


                                       i


<PAGE>   3
<TABLE>
<S>                                                                                            <C>

7.  Miscellaneous............................................................................     6
        7.1  Governing Law...................................................................     6
        7.2  Survival; Additional Securities.................................................     6
        7.3  Successors and Assigns..........................................................     7
        7.4  Entire Agreement................................................................     7
        7.5  Notices.........................................................................     7
        7.6  Amendments and Waivers..........................................................     7
        7.7  Legal Fees......................................................................     7
        7.8  Expenses........................................................................     7
        7.9  Titles and Subtitles............................................................     7
        7.10  Counterparts...................................................................     7
        7.11  Severability...................................................................     7
        7.13  Confidentiality................................................................     8
</TABLE>


                                       ii


<PAGE>   4
                            STOCK PURCHASE AGREEMENT



               THIS STOCK PURCHASE AGREEMENT (this "Agreement") is made as of
the 31st day of January, 2000, by and between Selectica, Inc., a Delaware
corporation (the "Company") and Samsung SDS (the "Investor").

               WHEREAS, the Investor has indicated a desire to purchase
1,000,000 shares of the Company's Common Stock .

               WHEREAS, the Company has indicated a desire to sell 1,000,000
shares of the Company's Common Stock to the Investor on the terms set forth
herein.

               WHEREAS, the Company and the Investor have agreed that this
Agreement shall constitute the entire understanding and agreement between the
parties with regard to the subject matter hereof.

               NOW, THEREFORE, THE PARTIES HEREBY AGREE AS FOLLOWS:

               1. Purchase and Sale of Stock.

                      1.1 Sale and Issuance of Stock. Subject to the terms and
conditions of this Agreement, the Company agrees to sell to the Investor and the
Investor agrees to purchase from the Company the number of shares of the
Company's Common Stock indicated on Exhibit A hereto (the "Stock"), having the
rights, preferences, privileges and restrictions set forth in the Second Amended
and Restated Certificate of Incorporation of the Company (the "Restated
Certificate") to be filed with the Delaware Secretary of State upon the Closing
(as defined below), the form of which has been filed as Exhibit 3.2 to the
Company's Registration Statement (the "Registration Statement") on Form S-1
(File No. 333-92545) for the Company's initial public offering (the "IPO").

                      1.2 The Closing. The purchase and sale of the Stock shall
be held at the Company's offices immediately following the closing of the IPO
or, if later, upon satisfaction or waiver of each of the conditions set forth in
Sections 4 and 5 (the "Closing"). At the Closing, the Company will deliver the
Stock to the Investor against payment of the purchase price therefor by check
payable to the order of the Company or by wire transfer. The per share purchase
price for the Stock shall be ninety-six percent (96%) the "Price to Public" for
one share of the Company's Common Stock specified in the final prospectus with
respect to the IPO.

               2. Representations and Warranties of the Company. The Company
hereby represents and warrants to the Investor that:

                      2.1 Organization and Good Standing. The Company is a
corporation duly organized, validly existing and in good standing under the laws
of the State of Delaware and has all requisite corporate power and authority to
carry out the transaction contemplated by this Agreement and to carry on its
business as now conducted. The Company is duly qualified to


<PAGE>   5
transact business and is in good standing in each jurisdiction in which the
failure to so qualify would have a material adverse effect on its business or
properties.

                      2.2 Authorization. All corporate action on the part of the
Company, its officers, directors, stockholders and any third party necessary for
the authorization, execution and delivery of this Agreement, the performance of
all obligations of the Company hereunder, and the authorization, issuance, sale
and delivery of the Stock has been taken or will be taken prior to the Closing,
and this Agreement constitutes a valid and legally binding obligation of the
Company, enforceable in accordance with its terms, except (i) as limited by
applicable bankruptcy, insolvency, reorganization, moratorium, and other laws of
general application affecting enforcement of creditors' rights generally and
(ii) as limited by laws relating to the availability of specific performance,
injunctive relief, or other equitable remedies.

                      2.3 Valid Issuance of Stock. The Stock, when issued, sold
and delivered in accordance with the terms hereof for the consideration
expressed herein, will be duly and validly issued, fully paid and nonassessable
and will be free of restrictions on transfer other than restrictions on transfer
under this Agreement and under applicable state and federal securities laws.
There are no statutory or contractual shareholders' preemptive rights or rights
of first refusal with respect to the issuance of the Stock other than rights
that have been satisfied or waived. Subject in part to the truth and accuracy of
the Investor's representations set forth in Section 3 of this Agreement, the
offer, sale and issuance of the Stock as contemplated by this Agreement are
exempt from the registration requirements of any applicable state and federal
securities laws.

                      2.4 Title to Property and Assets. The Company owns its
property and assets free and clear of all mortgages, liens, loans and
encumbrances, except such encumbrances and liens that arise in the ordinary
course of business and do not materially impair the Company's ownership or use
of such property or assets. With respect to the property and assets it leases,
the Company is in compliance with such leases and, to the best of its knowledge,
holds a valid leasehold interest free of any liens, claims or encumbrances.

                      2.5 Compliance with Other Documents. The execution and
delivery of this Agreement, consummation of the transactions contemplated
hereby, and compliance with the terms and provisions hereof will not conflict
with or result in a breach of the terms and conditions of, or constitute a
default under the Certificate of Incorporation or Bylaws of the Company or of
any contract or agreement to which the Company is now a party, except where such
conflict, breach or default of any such contract or agreement, either
individually or in the aggregate, would not have a material adverse effect on
the Company's business, financial condition or results of operations.

                      2.6 Registration Statement. The Registration Statement
shall not, at the time the Registration Statement (including any amendments or
supplements thereto) is declared effective by the Securities and Exchange
Commission ("SEC"), contain any untrue statement of a material fact or omit to
state any material fact necessary in order to make the statements therein, in
light of the circumstances under which they were made, not misleading.


                                       2


<PAGE>   6
                      2.7 Litigation. Except as disclosed in the Registration
Statement, there are no actions, proceedings or investigations pending against
the Company, that, either in any case or in the aggregate, would result in any
material adverse change in the business, financial condition, or results of
operations of the Company.

                      2.8 Intellectual Property. Except as disclosed in the
Registration Statement, the Company owns, possesses or can acquire on reasonable
terms, adequate trade names and other rights to inventions, know-how,
copyrights, confidential information and other intellectual property and, to the
Company's knowledge, trademarks and patents (collectively, "Intellectual
Property Rights") necessary to conduct the business now operated by it, or
presently employed by it, and has not received any notice of infringement of or
conflict with asserted rights of others with respect to any intellectual
property rights that, if determined adversely to the Company, would individually
or in the aggregate have a material adverse effect on the condition (financial
or other), business, properties or results of operations.

                      2.9 Financial Statements. The financial statements
included in the Registration Statement present fairly the financial position of
the Company as of the dates shown and its results of operations and cash flows
for the periods shown, reflect all material liabilities to which the Company is
subject, and, except as otherwise disclosed in the Registration Statement, such
financial statements have been prepared in conformity with the generally
accepted accounting principles in the United States applied on a consistent
basis.

                      2.10 Changes. Except as disclosed in the Registration
Statement, since the date of the latest audited financial statements included in
the Registration Statement there has been no material adverse change, nor any
development or event involving a prospective material adverse change, in the
condition (financial or other), business, properties or results of operations of
the Company taken as a whole.

                      2.11 Taxes. The Company has filed on a timely basis all
tax returns and reports (including information returns and reports) as required
by law. These returns and reports are true and correct in all material respects
except to the extent that a reserve has been reflected on the Company's
financial statements in accordance with generally accepted accounting
principles. The Company has paid all taxes and other assessments due, except
those contested by it in good faith and except to the extent that a reserve has
been reflected on the Company's financial statements in accordance with
generally accepted accounting principles. The provision for taxes of the Company
as shown in the Company's financial statements is adequate for taxes due or
accrued as of the date thereof.

               3. Representations and Warranties of the Investor. The Investor
hereby represents and warrants that:

                      3.1 Authorization. This Agreement constitutes the valid
and legally binding obligation of the Investor, enforceable in accordance with
its terms, subject to laws of general application relating to bankruptcy,
insolvency and the relief of debtors and by general principles of equity.


                                       3


<PAGE>   7
                      3.2 Investigation. The Investor acknowledges that it has
had an opportunity to discuss the business, affairs and current prospects of the
Company with the Company's chief executive officer or other executive officers.
The Investor further acknowledges having had access to information about the
Company that it has requested or considers necessary for purposes of purchasing
the Stock. The foregoing, however, does not limit or modify the representations
and warranties of the Company in Section 2 of this Agreement or the right of the
Investors to rely thereon.

                      3.3 Accredited Investor. The Investor is an "accredited
investor" as such term is defined in Regulation D adopted by the SEC.

                      3.4 Purchase Entirely for Own Account. This Agreement is
made with the Investor in reliance upon the Investor's representation to the
Company, which by the Investor's execution of this Agreement the Investor hereby
confirms, that the Stock will be acquired for investment for the Investor's own
account, not as a nominee or agent, and not with a view to the resale or
distribution of any part thereof, and that the Investor has no present intention
of selling, granting any participation in, or otherwise distributing the same.

                      3.5 Restricted Securities. Investor understands that the
Stock it is purchasing are characterized as "restricted securities" under the
federal securities laws inasmuch as they are being acquired from the Company in
a transaction not involving a public offering and that under such laws and
applicable regulations such securities may be resold without registration under
the Securities Act of 1933, as amended (the "Act"), only in certain limited
circumstances. In this connection, Investor represents that it is familiar with
SEC Rule 144, as presently in effect, and understands the resale limitations
imposed thereby and by the Act.

               4. Conditions to the Investor's Obligation at Closing. The
obligation of the Investor to purchase the Stock at the Closing is subject to
the fulfillment to the Investor's satisfaction on or prior to the Closing of the
following conditions:

                      4.1 Representations and Warranties. The representations
and warranties made by the Company in Section 2 hereof shall be true and correct
when made, and shall be true and correct as of the Closing with the same force
and effect as if they had been made on and as of such date, and all covenants
made by the Company shall have been performed to Investor's satisfaction. The
Chief Executive Officer of the Company shall deliver at the Closing a
certificate stating that the condition specified in the preceding sentence has
been fulfilled.

                      4.2 Securities Laws. The offer and sale of the Stock to
the Investor pursuant to this Agreement shall be exempt from the registration
requirements of the Act and qualification requirements of all applicable state
securities laws.

                      4.3 Authorizations. All authorizations, approvals or
permits, if any, of any governmental authority or regulatory body that are
required in connection with the lawful issuance and sale of the Stock pursuant
to this Agreement shall have been duly obtained and shall be effective on and as
of the Closing.


                                       4


<PAGE>   8
                      4.4 Initial Public Offering of Common Stock. The closing
of the IPO shall have occurred.

               5. Conditions to the Company's Obligations at Closing. The
obligation of the Company to sell the Stock at the Closing is subject to the
fulfillment to the Company's satisfaction on or prior to the Closing of the
following conditions:

                      5.1 Representations and Warranties. The representations
and warranties of the Investor contained in Section 3 hereof shall be true as of
the Closing with the same force and effect as if they had been made on and as of
such date, subject to changes contemplated by this Agreement.

                      5.2 Securities Laws. The offer and sale of the Stock to
the Investor pursuant to this Agreement shall be exempt from the registration
requirements of the Act qualification requirements of all applicable state
securities laws.

                      5.3 Authorizations. All authorizations, approvals or
permits, if any, of any governmental authority or regulatory body that are
required in connection with the lawful issuance and sale of the Stock pursuant
to this Agreement shall have been duly obtained and shall be effective on and as
of the Closing.

                      5.4 Initial Public Offering of Common Stock. The closing
of the IPO shall have occurred.

                      5.5 Payment of Purchase Price. The Investor shall have
delivered to the Company the purchase price for the Stock as set forth in
Section 1.2 hereof.

                      5.6 Lock-Up Agreement. The Investor shall have delivered
to the Company an executed Lock-Up Agreement with Credit Suisse First Boston
Corporation, the form of which is attached as Exhibit B hereto.

               6. Covenants of the Company and the Investor.

                      6.1 Agreement Not to Transfer.

                           (a) Prior to the first anniversary of the Closing,
the Investor shall not, directly or indirectly, sell, offer to sell, contract to
sell (including, without limitation, any short sale), grant any option to
purchase or otherwise transfer or dispose of any securities of the Company held
by it at any time during such period (a "Transfer") unless the Company consents
to such Transfer and the transferee agrees to be bound by this Agreement;
provided, however, that the Investor may transfer shares of the Company's Common
Stock to an entity in which the Investor holds fifty percent (50%) or more of
the voting stock or to any partner, limited partner or affiliate of such
Investor without the Company's consent so long as the transferee agrees to be
bound by this Agreement; and provided further, however, that beginning 181 days
after the date of the final prospectus with respect to the IPO, the Investor may
hedge up to all of the Stock if not less than 5 days prior thereto the Investor
delivers to the Company the written opinion of its counsel, in form and
substance reasonably acceptable to the Company, to the effect that such
transaction, either alone or together with all other such transactions by the


                                       5


<PAGE>   9
Investor, will not jeopardize or otherwise adversely affect the exemption from
registration under the Securities Act relied upon by the Company for the
issuance of the Stock.

                           (b) In order to enforce the restrictions on Transfer
set forth in 6.1(a) above (the "Transfer Restrictions"), the Company may impose
stop transfer instructions with respect to the Stock until the end of the
restricted period.

                      6.2 Market Stand-Off. In addition to the Transfer
Restrictions (which shall in no way be limited by the following), in connection
with any underwritten public offering by the Company of its equity securities
pursuant to an effective registration statement filed under the Act, the
Investor shall not Transfer any shares of the Stock, except for Common Stock
included in such registration, without the prior written consent of the Company
and its underwriters. Such restriction (the "Market Stand-Off") shall be in
effect for such period of time from and after the effective date of the final
prospectus for the offering as may be requested by the Company or such
underwriters; provided, however, that (i) such Market Stand-Off shall not exceed
one hundred eighty (180) days, and (ii) the Investor shall be subject to the
Market Stand-Off only if all officers, directors, entities that are affiliates
of any director and any shareholder owning at least 5% of the outstanding shares
of the Company enter into similar agreements. In order to enforce the Market
Stand-Off, the Company may impose stop-transfer instructions with respect to the
Stock until the end of the applicable stand-off period.

                      6.3 Registration of Stock. The Company agrees that, with
regard to the Stock, the Investor shall have the registration rights described
in Exhibit C attached hereto. The Investor understands and agrees that (i) the
Stock will be characterized as "restricted securities" under the federal
securities laws inasmuch as it is being acquired from the Company in a
transaction not involving a public offering and that under such laws and
applicable regulations such securities may be resold without registration under
the Act only in certain limited circumstances, and (ii) each certificate
representing the Stock and any other securities issued in respect of the Stock
upon any stock split, stock dividend, recapitalization, merger or similar event
(unless no longer required in the opinion of counsel for the Company) shall be
stamped or otherwise imprinted with appropriate legends mandated by federal and
state securities laws.

               7. Miscellaneous.

                      7.1 Governing Law. This Agreement shall be governed in all
respects by the laws of the State of California as applied to agreements among
California residents entered into and to be performed entirely within
California, without regard to the conflict of law provisions thereof.

                      7.2 Survival; Additional Securities. The representations
and warranties set forth in Sections 2 and 3 shall survive until two years after
the date of the Closing. The covenants and agreements set forth in Section 6
shall survive in accordance with their terms. Any new, substituted or additional
securities which are by reason of any stock split, stock dividend,
recapitalization or reorganization distributed with respect to the Stock ("Stock
Distributions") shall be immediately subject to the covenants and agreements set
forth in Section 6 to the same extent the Stock is at such time covered by such
provisions.


                                       6


<PAGE>   10
                      7.3 Successors and Assigns. Except as otherwise expressly
provided herein, the provisions hereof shall inure to the benefit of, and be
binding upon, the respective successors and assigns of the parties hereto.
Nothing in this Agreement, express or implied, is intended to confer upon any
party other than the parties hereto or their respective successors and assigns
any rights, remedies, obligations, or liabilities under or by reason of this
Agreement, except as expressly provided in this Agreement. Notwithstanding
anything to the contrary contained herein, the covenants set forth in Section 6
shall not be binding upon any entity (other than an affiliate of the Investor)
which acquires any shares of the Stock or a Stock Distribution in a transaction
permitted hereunder.

                      7.4 Entire Agreement. This Agreement constitutes the
entire understanding and agreement between the parties with regard to the
subject matter hereof.

                      7.5 Notices. Except as otherwise provided, all notices and
other communications required or permitted hereunder shall be in writing, shall
be effective when given, and shall in any event be deemed to be given upon
receipt or, if earlier, (i) five (5) days after deposit with the U.S. postal
service or other applicable postal service, if delivered by first class mail,
postage prepaid, (ii) upon delivery, if delivered by hand, (iii) one (1)
business day after the day of deposit with Federal Express or similar overnight
courier, freight prepaid, if delivered by overnight courier or (iv) one (1)
business day after the day of facsimile transmission, if delivered by facsimile
transmission with copy by first class mail, postage prepaid, and shall be
addressed, (a) if to the Investor, at the Investor's address set forth below its
signature, or (b) if to the Company, at its address as set forth below its
signature, or at such other address as the Company shall have furnished to the
Investor in writing.

                      7.6 Amendments and Waivers. Any term of this Agreement may
be amended and the observance of any term of the Agreement may be waived (either
generally or in a particular instance and either retroactively or prospectively)
only with the written consent of the Company and the Investor.

                      7.7 Legal Fees. In the event of any action at law, suit in
equity or arbitration proceeding in relation to this Agreement or the Stock or
any Stock Distribution, the prevailing party shall be paid by the other party a
reasonable sum for the attorneys' fees and expenses incurred by such prevailing
party.

                      7.8 Expenses. Irrespective of whether the Closing is
effected, the Company and the Investor shall each pay their own costs and
expenses incurred with respect to the negotiation, execution, delivery and
performance of this Agreement.

                      7.9 Titles and Subtitles. The titles of the paragraphs and
subparagraphs of this Agreement are for convenience of reference only and are
not to be considered in construing this Agreement.

                      7.10 Counterparts. This Agreement may be executed in
counterparts, each of which shall be an original, but all of which together
shall constitute one instrument.

                      7.11 Severability. If one or more provisions of this
Agreement are held to be unenforceable under applicable law, such provision
shall be excluded from this Agreement


                                       7


<PAGE>   11
and the balance of the Agreement shall be interpreted as if such provision were
so excluded and shall be enforceable in accordance with its terms.

                      7.12 Confidentiality. The parties hereto agree that:

                           (a) except with the prior written permission of the
other party, it shall at all times keep confidential and not divulge, furnish,
or make accessible to anyone any confidential information, knowledge, or data
concerning or relating to the business or financial affairs of such other party
to which said party has been or shall become privy by reason of this Agreement,
discussions or negotiations relating to this Agreement, or the performance of
its obligations hereunder.

                           (b) the Company shall not disclose Investor's (or any
of its Affiliates') name or identity as an investor in the Company in any press
release or other public announcement or in any document or material filed with
any governmental entity (including the Registration Statement, without the prior
written consent of Investor (or its applicable Affiliate(s)), unless such
disclosure is required by applicable law or governmental regulations or by order
of a court of competent jurisdiction, in which case prior to making such
disclosure the Company shall give written notice to Investor (as applicable),
describing in reasonable detail the proposed content of such disclosure and
shall permit Investor (as applicable), to review and comment upon the form and
substance of such disclosure; provided, however, that once such information has
been disclosed pursuant to this section 7.12, the Company shall not be required
to obtain Investor's consent or consultation for subsequent disclosures of such
information.


                                       8


<PAGE>   12
               IN WITNESS WHEREOF, the parties hereto have executed this
Agreement as of the day and year hereinabove first written.


                             SELECTICA, INC.



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

                  Address:   3 West Plumeria Drive
                             San Jose, California  95134




                             SAMSUNG SDS



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


                  Address:
                             ------------------------------------------


<PAGE>   13
                                    EXHIBIT A



<TABLE>
<CAPTION>
Investor                                    Number of Shares
--------                                    ----------------
<S>                                         <C>
Samsung SDS                                 1,000,000
</TABLE>


                                      E-2


<PAGE>   14
                                    EXHIBIT B


                                      E-3


<PAGE>   15
                                    EXHIBIT C



               1. Registration Rights. The Company covenants and agrees as
follows:

                      1.1 Definitions. For purposes of this Exhibit C,
capitalized terms used herein and not otherwise defined shall have the meanings
ascribed to them in the Stock Purchase Agreement between the Company and the
Investor to which this Exhibit C is attached. In addition, the following terms
used herein shall have the following meanings: (a) the term "1934 Act" means the
Securities Exchange Act of 1934, as amended; and (b) the term "register",
"registered," and "registration" refer to a registration effected by preparing
and filing a registration statement or similar document in compliance with the
Act, and the declaration or ordering of effectiveness of such registration
statement or document.

                      1.2 Company Registration.

                           (a) If, at any time 180 days after the Registration
Statement is declared effective by the SEC, the Company proposes to register any
of its stock or other securities under the Act in connection with the public
offering of such securities (other than a registration relating solely to the
sale of securities to participants in a Company stock plan, a registration
relating to a corporate reorganization or other transaction under Rule 145 of
the Act, a registration on any form that does not include substantially the same
information as would be required to be included in a registration statement
covering the sale of the Stock, or a registration in which the only Common Stock
being registered is Common Stock issuable upon conversion of debt securities
that are also being registered), the Company shall, at such time, promptly give
Investor written notice of such registration. Upon the written request of
Investor given within twenty (20) days after mailing of such notice by the
Company, the Company shall, subject to the provisions of Section 1.2(c) below,
use all reasonable efforts to cause to be registered under the Act all of the
Stock that each Investor has requested to be registered. Nothing contained in
this Section 1.2 obligates the Company to register any of its stock or other
securities under the Act.

                           (b) The Company shall have the right to terminate or
withdraw any registration initiated by it under this Section 1.2 prior to the
effectiveness of such registration whether or not Investor has elected to
include securities in such registration.

                           (c) In connection with any offering involving an
underwriting of shares of the Company's capital stock, the Company shall not be
required under this Section 1.2 to include any of the Investor's securities in
such underwriting unless Investor accepts the terms of the underwriting as
agreed upon between the Company and the underwriters selected by it (or by other
persons entitled to select the underwriters) and enter into an underwriting
agreement in customary form with an underwriter or underwriters selected by the
Company, and then only in such quantity as the underwriters determine in their
sole discretion will not jeopardize the success of the offering by the Company.
If the total amount of securities, including share of the Stock, requested by
stockholders to be included in such offering exceeds the amount of securities
sold other than by the Company that the underwriters determine in their sole
discretion is compatible with the success of the offering, then the Company
shall be required to include in the offering only that number of such
securities, including shares of the Stock, that


                                      E-4


<PAGE>   16
the underwriters determine in their sole discretion will not jeopardize the
success of the offering. The securities to be so included shall be apportioned
pro rata among the selling stockholders, including the Investor, the Holders of
Registrable Securities (as such terms are defined in that certain Amended and
Restated Investor Rights Agreement dated June 16, 1999, by and among the Company
and certain of its stockholders) and any other stockholder of the Company
entitled to similar registration rights, according to the total amount of
securities entitled to be included therein owned by each selling stockholder or
in such other proportions as shall mutually be agreed to by such selling
stockholders.

                      1.3 Investor Obligation to Furnish Information. It shall
be a condition precedent to the obligations of the Company to take any action
pursuant hereto with respect to the Stock that the Investor shall furnish to the
Company such information regarding itself, the Stock, and the intended method of
disposition of such securities as shall be required to effect the registration
of such Stock.

                      1.4 Expenses of Registration. All expenses incurred in
connection with registrations, filings or qualifications pursuant hereto,
including (without limitation) all registration, filing and qualification fees,
printers' and accounting fees, fees and disbursements of counsel for the Company
(including fees and disbursements of counsel for the Company in its capacity as
counsel to the Investor hereunder but excluding the fees and disbursements of
any other counsel for the Investor) shall be borne by the Company.

                      1.5 Indemnification. In the event any Stock is included in
a registration statement under Section 1.2:

                           (a) To the extent permitted by law, the Company will
indemnify and hold harmless the Investor, any underwriter (as defined in the
Act) for the Investor and each person, if any, who controls the Investor or
underwriter within the meaning of the Act or the 1934 Act, against any losses,
claims, damages, or liabilities (joint or several) to which they may become
subject under the Act, the 1934 Act or other federal or state law, insofar as
such losses, claims, damages, or liabilities (or actions in respect thereof)
arise out of or are based upon any of the following statements, omissions or
violations (collectively a "Violation"): (i) any untrue statement or alleged
untrue statement of a material fact contained in such registration statement,
including any preliminary prospectus or final prospectus contained therein or
any amendments or supplements thereto, (ii) the omission or alleged omission to
state therein a material fact required to be stated therein, or necessary to
make the statements therein not misleading, or (iii) any violation or alleged
violation by the Company of the Act, the 1934 Act, any state securities law or
any rule or regulation promulgated under the Act, the 1934 Act or any state
securities law; and the Company will pay to the Investor, or such underwriter or
controlling person, as incurred, any legal or other expenses reasonably incurred
by them in connection with investigating or defending any such loss, claim,
damage, liability, or action; provided, however, that the indemnity agreement
contained in this subsection (a) shall not apply to amounts paid in settlement
of any such loss, claim, damage, liability, or action if such settlement is
effected without the consent of the Company (which consent shall not be
unreasonably withheld), nor shall the Company be liable in any such case for any
such loss, claim, damage, liability, or action to the extent that it arises out
of or is based upon a Violation which occurs in reliance upon and


                                      E-5


<PAGE>   17
in conformity with written information furnished expressly for use in connection
with such registration by any such Investor, underwriter or controlling person.

                           (b) To the extent permitted by law, the Investor will
indemnify and hold harmless the Company, each of its directors, each of its
officers who has signed the registration statement, each person, if any, who
controls the Company within the meaning of the Act, any underwriter, and any
controlling person of any such underwriter, against any losses, claims, damages,
or liabilities (joint or several) to which any of the foregoing persons may
become subject, under the Act, the 1934 Act or other federal or state law,
insofar as such losses, claims, damages, or liabilities (or actions in respect
thereto) arise out of or are based upon any Violation, in each case to the
extent (and only to the extent) that such Violation occurs in reliance upon and
in conformity with written information furnished by such Investor expressly for
use in connection with such registration; and each such Investor will pay, as
incurred, any legal or other expenses reasonably incurred by any person intended
to be indemnified pursuant to this subsection (b), in connection with
investigating or defending any such loss, claim, damage, liability, or action;
provided, however, that the indemnity agreement contained in this subsection (b)
shall not apply to amounts paid in settlement of any such loss, claim, damage,
liability or action if such settlement is effected without the consent of the
Investor, which consent shall not be unreasonably withheld; provided, that, in
no event shall any indemnity under this subsection (b) exceed the gross proceeds
from the offering received by the Investor.

                           (c) Promptly after receipt by an indemnified party
under this Section 1.5 of notice of the commencement of any action (including
any governmental action), such indemnified party will, if a claim in respect
thereof is to be made against any indemnifying party under this Section 1.5,
deliver to the indemnifying party a written notice of the commencement thereof
and the indemnifying party shall have the right to participate in, and, to the
extent the indemnifying party so desires, jointly with any other indemnifying
party similarly noticed, to assume the defense thereof with counsel mutually
satisfactory to the parties; provided, however, that an indemnified party
(together with all other indemnified parties which may be represented without
conflict by one counsel) shall have the right to retain one separate counsel,
with the fees and expenses to be paid by the indemnifying party, if
representation of such indemnified party by the counsel retained by the
indemnifying party would be inappropriate due to actual or potential differing
interests between such indemnified party and any other party represented by such
counsel in such proceeding. The failure to deliver written notice to the
indemnifying party within a reasonable time of the commencement of any such
action, if prejudicial to its ability to defend such action, shall relieve such
indemnifying party of any liability to the indemnified party under this Section
1.5, but the omission so to deliver written notice to the indemnifying party
will not relieve it of any liability that it may have to any indemnified party
otherwise than under this Section 1.5.

                           (d) If the indemnification provided for in this
Section 1.5 is held by a court of competent jurisdiction to be unavailable to an
indemnified party with respect to any loss, liability, claim, damage, or expense
referred to there in, then the indemnifying party, in lieu of indemnifying such
indemnified party hereunder, shall contribute to the amount paid or payable by
such indemnified party as a result of such loss, liability, claim, damage, or
expense in such proportion as is appropriate to reflect the relative fault of
the indemnifying party on the one hand and of the indemnified party on the other
in connection with the statements or omissions


                                      E-6


<PAGE>   18
that resulted in such loss, liability, claim, damage, or expense as well as any
other relevant equitable considerations. The relative fault of the indemnifying
party and of the indemnified party shall be determined by reference to, among
other things, whether the untrue or alleged untrue statement of a material fact
or the omission to state a material fact relates to information supplied by the
indemnifying party or by the indemnified party and the parties' relative intent,
knowledge, access to information, and opportunity to correct or prevent such
statement or omission.

                           (e) Notwithstanding the foregoing, to the extent that
the provisions on indemnification and contribution contained in an underwriting
agreement entered into in connection with the underwritten public offering are
in conflict with the foregoing provisions, the provisions in the underwriting
agreement shall control.

                           (f) The obligations of the Company and the Investor
under this Section 1.5 shall survive the completion of any offering of the Stock
in a registration statement pursuant hereto, and otherwise.

                      1.6 Termination. The Company's obligation to register the
Stock pursuant to this agreement shall terminate on the earlier of (i) the third
anniversary of the Closing and (ii) the date on which all shares of the Stock
held by the Investor may immediately be sold under Rule 144 during any 90-day
period.


                                      E-7

<PAGE>   19
                                AMENDMENT #1 TO
                            STOCK PURCHASE AGREEMENT
                    BETWEEN SELECTICA, INC. AND SAMSUNG SDS



     This Amendment #1 ("Amendment #1") to the Stock Purchase Agreement between
Selectica, Inc, ("SELECTICA") and Samsung SDS ("Samsung") dated January 31,
2000 (the "Agreement"), is made as of this 8th day of February 2000 by and
among SELECTICA and Samsung.

                                    RECITAL

     On January 31, 2000, SELECTICA and Samsung entered into the Agreement by
which Samsung had agreed to purchase 1,000,000 shares of the Company's Common
Stock. The parties to the Agreement now wish to amend the Agreement to increase
the number of shares Samsung is purchasing pursuant to the Agreement to
1,200,000 shares of the Company's Common Stock.

                                   AGREEMENT

     In consideration of the mutual promises, covenants and conditions
hereinafter set forth, the parties hereto mutually agree to amend the Agreement
in the following manner:

     Wherever the number "1,000,000" appears in the Agreement, that number
shall be changed to "1,200,000." All other terms and conditions of the
Agreement shall remain unchanged.

     This Amendment may be executed in any number of counterparts, each of
which shall be deemed an original, but all of which together shall constitute
one instrument.

     IN WITNESS WHEREOF, the parties have caused this Amendment #1 to the
Agreement to be duly signed and authorized.

SAMSUNG SDS

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

        ---------------------------


SELECTICA, INC.

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

        ---------------------------