Buffer is just a variant of the output type that can be read-back internally. The interface of a RAM model will necessarily use an inout type for the data port. Building a RAM model involves multplexing a memory array to the data port for read and write.
I guess, you should start with learning VHDL syntax. Both examples in your post show incorrect syntax. Or study existing RAM models from a text book or a vendor tool tutorial.