I am trying Anti-aliasing in my code but it's not working.
please help me.
al_set_new_display_option(ALLEGRO_SAMPLE_BUFFERS, 1, ALLEGRO_SUGGEST);
al_set_new_display_option(ALLEGRO_SAMPLES, 8, ALLEGRO_SUGGEST);
al_set_new_bitmap_flags(ALLEGRO_MIN_LINEAR | ALLEGRO_MAG_LINEAR);
the code above which I copied from GitHub's Wiki
the code which I wrote
ALLEGRO_*_LINEAR only works for filtering bitmaps. ALLEGRO_SUGGEST is just that, a suggestion. It doesn't gurantee that the option you requested is active. You have to check with al_get_display_option to see if it was successful.
Is there a way to get smoother primitives guaranteed?
I want to make something with primitives, which library can provide me vector graphics like primitives?
There is no guarantee. You can use ALLEGRO_REQUIRE and check for a null display. Also, primitives are not vector graphics. Vector graphics can scale to any size.
Also, primitives are not vector graphics.
This is not correct.
I am trying Anti-aliasing in my code but it's not working.
What OS? If it's Windows, maybe try OpenGL.
Okay so draw an arc at two different sizes and tell me the curvature is the same. Primitives are approximations. Vector graphics can be drawn with primitives but that doesn't make them the same.
which library can provide me vector graphics like primitives?
Maybe worth mentioning that if you're including vector graphics storage formats (like SVG) in that question: these can't be rendered with Allegro 5. There might be a library out there that can load an SVG and resolve its paths to vertices for a given scale, but a quick Google yielded nothing for me.
However, because of SVG's abundance, I wonder whether this'd make a good add-on?
Run time generation of SVG images scaled to destination would be cool. Pre-rendered or drawn on the fly? There's a big performance hit for decoding it multiple times, and there's always mip-maps.
librsvg will do it. You'd have to make cairo render to a memory buffer which could be converted to an ALLEGRO_BITMAP.
SVG is so complicated that I would imagine doing that in real time would be quite slow.
Hmm, so vector graphics for GUI is a no?
I wonder, How are browsers like Mozilla and Chrome are drawing so smooth layouts?
GUIs absolutely can (and arguably should) be built from vector graphics such that you can do smooth DPI scaling. The user always has the option to veto antialiasing regardless.
How are browsers like Mozilla and Chrome are drawing so smooth layouts?
Trust me, you don't want to worry about how web browsers optimise their renders. It isn't pretty. 
You'd have to make cairo render to a memory buffer which could be converted to an ALLEGRO_BITMAP.
Huh, this'd be great if we're happy to do the initial [expensive] rasterisation at init, so we end up with mipmaps like Edgar's suggesting.
You can do realtime rendering of resolution independent curves in with antialiasing on a non-MSAA framebuffer: https://www.microsoft.com/en-us/research/wp-content/uploads/2005/01/p1000-loop.pdf
I have an implementation for quadratic curves that's really optimized: https://github.com/aaronbolyard/Algae.Canvas
It's just patented until 2026. Thus, unless you license it, you're SOL unless you find a different way of doing it. 
I decided the difficulties aren't worth it and have been using vector graphics rasterized offline (ItsyRealm) or vector graphics decomposed into straight lines segments then rasterized to a texture at runtime (Lacklore; necessary for changing fill styles, etc at runtime).