The film was inspired by a dream Sophie Barthes had in which Woody Allen discovers that his soul looks just like a chickpea. Barthes wrote the first draft with Allen in mind for the lead role.
The script includes associations and intentions from Johann Wolfgang von Goethe's "Faust", "Dead Souls" by Nikolay Gogol, "The Hands of Orlac" by Maurice Renard, and Hans Christian Andersen's "The Princess and the Pea".
Paul Giamatti claimed that he received many offers to play Uncle Vanya, which he turned down, because he felt the role was too similar to other characters he has already.
The movie opens with an onscreen quote that says: "The soul has its principal seat in the small gland located in the middle of the brain." -René Descartes, The Passions of the Soul, 1649.