Personal Encyclopedia app I figure I should ask this before I start writing my own...

I'm looking for an app that I can use as a repository of information about a subject.  Here's the sort of features I want:


Individual "articles" where I can write about the things I've learned/discovered/theorized
Be able to tag these articles with keywords (like tags on this question)
Be able to group these articles into folders of related stuff.
Smart folders would be especially nice.
Be able to write these articles in a simple format.  Markdown would be wonderful.
Be able to search through the articles to find stuff/Spotlight integration.
Must be a native Mac app. Not a web app. Having a companion iOS app would be a major bonus.
Article versioning would be nice.
Automatically detecting related articles (even a simple algorithm) would be nice.


Basically, I think I want an off-line, personal Wikipedia that I can write in Markdown. Do any of you know of an app (or apps) that does what I'm looking for?
You might try also DEVONthink which is a bit expensive but works for me.