Let $p$ be a prime number and $K$ a finite extension of $mathbb{Q}_p$. We state conjectures on the smooth representations of $mathrm{GL}_n(K)$ that occur in spaces of mod $p$ automorphic forms (for compact unitary groups). In particular, when $K$ is unramified, we conjecture that they are of finite length and predict their internal structure (extensions, form of subquotients) from the structure of a certain algebraic representation of $mathrm{GL}_n$. When $n=2$ and $K$ is unramified, we prove several cases of our conjectures, including new finite length results.