Now that France has boots on the ground and is doing real shooting everyone is an expert on Mali. I'm not, I won't claim any familiarity with the dynamics of that corner of the world. But from a superficial standpoint it looks like Afghanistan. There are enormous differences in the specifics (cultural, ethnic, linguistic, geographic, historical - I get it, they are totally different countries.) I also have nothing insightful to say about the terrible - and possibly related - events in Algeria.
The big similarity is that Mali, like Afghanistan, is in a difficult to reach place, is large, poor, and in real danger of being taken over by Islamists. The failed state in danger of being taken over by Islamists is a danger in many other places and the big question is what are realistic policy options.
From the experience of Afghanistan, dropping hundreds of billions of dollars and tens of thousands of troops is problematic. It is very, very expensive, it may have limited efficacy, it will distort local politics and economics, and the intervening power may not be willing to sustain it. The troops and resources needed to intervene in Mali on that scale don't exist anyway so what else is in the playbook?
Plan Colombia as a Counter-Example
In the 1990s the Colombian government was in real trouble. The whole country was insecure and the drug-financed FARC was an existential threat to the state itself. The United States engaged in a long-term capacity building program which provided technical assistance, training, money, and intelligence to the Colombian government. There were limited US personnel involved. Overall, the program was a success. Solving the fundamental social problems of Colombia was probably not in the cards, but the country's economy is growing while the FARC has been pushed to the margins and the security situation has been vastly improved.
Plan Colombia is a model program that required a substantial, but not overwhelming US commitment. Unfortunately, its applicability is limited. There was a lower level counter-terror capacity building program to Mali, but it was tiny, subject to bureaucratic differences, and ultimately de-railed by a coup that was not recognized by the US.
Capacity building won't work well when there is very little initial capacity. At its worst moments the Colombian government and security forces were a model of effectiveness compared to the truly failed states. In particular, the Colombian military was a professional force that needed support to adapt to its internal counter-insurgency role. Colombia also benefitted from exceptional political leadership that had the vision and capability to support the military.
None of these things exist in Mali, Somalia or other likely candidates for failed state status. But this lower level capacity building commitment at least provides a useful counter-point to the massive COIN commitment present in Afghanistan (a yin-yang thing.)
Just Right Policy
First, even weak, inept national governments can be useful. Handling things on the international stage requires an address - otherwise where can you send mail/aid/weapons etc. Waiting until that inept government is overthrown and letting Islamists (or other bad guys) run the country is a much less advantageous position.
Some troops are needed, enough to take out the bad guys and make sure they cannot mass forces. In Mali, it is looking like France's brigade with airpower (and US support) may be able to do the job. Naturally augmenting a core Western force with local or regional forces (ie Malian army and African peace-keepers) is useful. But regardless the forces needed to fully secure the country are not available (and might not succeed in any regard.)
However, if a nation is going to commit to stabilizing a country like Mali it means this kind of force will have to stick around for a long-time. To use that force effectively (and also to deliver economic aid and manage relations with sub-national actors - such as local warlords) will require the slow and painful accumulation of highly specific knowledge about that country. Developing that kind of knowledge means that governments have to be prepared to invest in personnel - effectively guaranteeing a number of people across agencies that they can have careers (ie several decades focusing on one area) as "Mali hands" or "Somalia hands" or whatever other area comes up on the national radar screen. This is not the old British civil service in India with tens of thousands - but rather a few hundred. They will need to be structured so that they work across a swath of agencies and continue to harbor a diversity of opinions.
(Caveat: I am not writing that this is what the French are doing! They probably want to get out ASAP. But this is the sort of thing they should do if they want to take a stab at ensuring they don't have an endless cycle of crises. The US should also look into building these kinds of capabilities to deploy in other dangerous areas of the world.)
This requires a broader institutional capacity to build this capacity. It will also require political patience with very long-term approaches and a tolerance for limited results and - quite frankly - deals with some really awful people.
The situation is not hopeless, these abilities exist in a limited form already.
Still, if failed states are going to continue to viewed as an international security problem than the proper tools are needed to address them.