The Liberty Stadium side found themselves trailing 22-13 at half-time. But they conjured up second half tries from Richard Fussell and Tom Grabham to get to within seven points of their hosts in a frantic finish.
It was a third successive defeat in Pool 4 for the Ospreys, who have to complete their campaign with a trip to Bath this week. Exeter Chiefs have qualified from Pool 4 for the play-offs.
Griffiths said: “It’s a learning curve for these young boys, whether it’s someone like Sam who has a bit more experience or the boys making their debuts, they’ll take something from it and we’ll be better from it.
“Making that transition from Premiership rugby into this level of competition is not easy. There’s room for growth, that’s for sure, and you’d like to think that in a year or two’s time, when these boys have got the experience, we’re going to be much stronger as a squad and have that depth in certain positions that we can’t afford to just go out and buy.
“It’s a development process, it takes time, but there’s some real positives there for us.”
And Griffiths said a lack of discipline cost the PRO12 leaders. He said: “In the first half there were too many penalties conceded. We gave Gloucester field position, we didn’t make them work to get into our 22 and we also put ourselves under a lot of pressure from our exits.
“Then, you can’t play your game when you’re men down and those yellow cards were killers. We were left chasing the game because of unnecessary mistakes. That’s all part of the learning process for a young group, having clarity when we are under pressure and knowing how to relieve it.”