A recently observed relation between ‘weakly nonassociative ’ algebras A (for which the associator (A, A 2, A) vanishes) and the KP hierarchy (with dependent variable in the middle nucleus A ′ of A) is recalled. For any such algebra there is a nonassociative hierarchy of ODEs, the solutions of which determine solutions of the KP hierarchy. In a special case, and with A ′ a matrix algebra, this becomes a matrix Riccati hierarchy which is easily solved. The matrix solution then leads to solutions of the scalar KP hierarchy. We discuss some classes of solutions obtained in this way.