UK scientists have developed a blood test to help doctors pick the best drug for patients with depression.
Medics currently have to rely on trial and error, meaning around half of the time the first type of antidepressant given fails to work.
The researchers from King's College London say checking a patient's blood could help identify accurate treatment.
Those who test positive for inflammation need more aggressive therapy from the outset, they say.
So far the researchers have tried out their blood test on a small number of volunteers - 140 people with depression.
They say they will need to do a large trial to check how well it might work in the real world.
The blood test, described in the International Journal of Neuropsychopharmacology, is the culmination of years of investigation.
It looks for two specific markers of inflammation - a compound called macrophage migration inhibitory factor (MIF) and another called interleukin-1beta.
In the study, patients with high levels of these markers were unlikely to respond to conventional, commonly prescribed SSRI and tricyclic antidepressants.
Lead researcher Prof Carmine Pariante said this knowledge could help tailor treatment to the individual - although the test needs more work and development to make sure it would be accurate enough to use more routinely.
"About a third of patients might have these inflammatory markers and they would be people we might encourage to go on more aggressive treatment."
Antidepressants are safe but they can have side effects.
Prof Pariante said: "We would not want to go in prescribing too much medicine if it's not necessary, but we would want to escalate people sooner rather than later if they need it."
He suspects the inflammation is the body's response to stress, but, paradoxically, it gets in the way of drug treatment.
High levels of inflammation can interfere with the same biological processes that are crucial for antidepressants to work.
Prof Pariante and his team are looking to test whether giving anti-inflammatory drugs alongside antidepressants might help.
But he cautioned: "Patients should not change their medication on their own or take an anti-inflammatory without guidance from their doctor."
Experts also point out that medication is not the only answer when it comes to managing depression.
Stephen Buckley from the mental health charity Mind said: "Different people will find that different treatments help to manage their mental health - what is most important is that people have the knowledge needed to access the treatment that works for them, whether this is medication, or alternatives such as talking therapies, or a mixture of both."
Marjorie Wallace from the mental health charity SANE said: "Being able to target those people with depression who don't respond to medication would be one of the most exciting steps forward in the treatment of mental illness for decades."
Jenny Edwards of the Mental Health Foundation said: "If this test is as comprehensive and effective as thought then today's news could mark a real sea-change in treatment."
There are a number of things you can do yourself to help improve your mood
Doctors recommend people with depression try to keep active and busy, both physically and socially
Self-help groups may also be useful to share experiences and meet people who are going through the same thing
While medication may also help, guidelines for the NHS say other therapies should be offered alongside antidepressants
These therapies include cognitive behavioural therapy (to combat negative thoughts) and mindfulness training (to focus on appreciating the here and now).