Associated to an abelian variety over a number field are several interesting and related groups: the motivic Galois group, the Mumford-Tate group, ℓ-adic monodromy groups, and the Sato-Tate group. Assuming the Mumford-Tate conjecture, we show that from two well chosen Frobenius polynomials of our abelian variety, we can recover the identity component of these groups (or at least an inner form), up to isomorphism, along with their natural representations. We also obtain a practical probabilistic algorithm to compute these groups by considering more and more Frobenius polynomials; the groups are connected and reductive and thus can be expressed in terms of root datum. These groups are conjecturally linked with algebraic cycles and in particular we obtain a probabilistic algorithm to compute the dimension of the Hodge classes of our abelian variety for any fixed degree.Corollary 1.3. Assume that Conjectures 4.3 and 4.5 hold for A. Let S be the (finite) set of primes ℓ for which (G • A ) Q ℓ is not quasi-split. Then for almost all prime ideals q and p of O K that split completely in K conn A , the polynomials P A,q (x) and P A,p (x) determine the group G • A,ℓ and the representation V ℓ (A) of G • A,ℓ up to isomorphism for all ℓ / ∈ S.Proof. From Theorem 1.1, we may assume that we know the root datum Ψ(G • A ), the homomorphismA , and the weights of G • A ⊆ GL V A with multiplicities. Take any prime ℓ / ∈ S and set, where the equality uses the Mumford-Tate conjecture assumption. By choosing an embedding Q ֒→ Q ℓ , we obtain the root datum Ψ(G) and the associated homomorphism µ G : Gal(Q ℓ /Q ℓ ) → Out(Ψ(G)). Since G is quasi-split, this information determines the algebraic group G = G • A,ℓ up to isomorphism, cf. §2.9. Since we know the weights of the representation (Gwith multiplicities, we also have enough information to determine the representation V ℓ (A) of G • A,ℓ up to isomorphism. Finally, the set S is finite, cf. Theorem 6.7 of [PR94].