If you experience difficulties getting your agapanthus to flower, you may want to check the following:
Watering: Too much water can decrease flowering and standing water can be fatal. This can be checked easily, if plants are in containers.
Roots: Agapanthus blooms best when almost pot-bound. Don't repot the plant into a larger pot size if the roots are not filling out the soil.
Sunlight: Ensure the plant is getting a minimum of 4-5 hours of direct sunlight.
Feed: Fertilisers high in phosphorus and potassium promote flowering rather than leaf growth.