![Image](https://forums.factorio.com/images/ext/10b86fca94d517e7d07f34820da4295e.jpg)
Five tiles of the conveyor belt is read, the inventory is normalized by the left combinator (by normalizing I mean if something has more than 0, it will be reduced to 1). The chest content is also normalized, and multiplied by -1. Then these two will be summed at the inserter, and the result of that will set the filter of the inserter. The value for a given item type will only be 1 if the item is in the chest, but it is not in that five tiles of the conveyor belt. All the conveyor belts are set to read their content, I forgot to show that on the screenshot.
This is only managing one side of the belt, so that might be full soon. In that case the row of readers on the conveyor belt can be extended to longer, and items will spread more.