Implementing a custom repository is simply a matter of implementing the Repository interface (see the bundled API docs for more details).