nominative singular pronoun + particle (sandhi form)
Analysis. ahaṃ (nominative singular of aham, 'I') + api (enclitic particle, 'too, also'); the final -ṃ of ahaṃ assimilates before the vowel, yielding ahampi.
Etymology. ahaṃ from PIE *ego-, cognate with English 'ego', Latin 'ego', Greek 'egō'. The sense is the speaker's direct self-reference. api is an adverbial particle meaning 'also, too', related to Sanskrit api; its original spatial sense (perhaps 'on top of, besides') has become purely additive.
Meanings from the Digital Pāḷi Dictionary; morphology and etymology by Claude.
Lite mode — plain HTML for e-readers and old browsers. Full version