How to write a recommendation letter if you are not sure about its appropriateness
Decline on the grounds that, indeed, you've worked too little together. 

However (and actually adding to Peter K.'s answer), a discussion in order to understand why they chose you might be useful -- meaning that usually one asks for recommendation from people with whom they've worked longer. If their background and intentions don't seem suitable, maybe also tip them that another career path would be better?