Unlike Vietnam, there is no reason why we cannot maintain some kind of military and diplomatic relations with Afghanistan after a complete ground withdrawal. In fact we should be putting the groundwork in place for these connections even before we withdraw. Vietnam was an essentially monolithic enemy. In contrast, Afghanistan is a highly fragmented society; in may ways more a collection of tribes than a nation. Our mistake, in many ways, was to treat it as if it were a nation - or a place where we could make a nation.
To do this we will have to break with Karzai, or have preliminary arrangements for him to gracefully withdraw. he commands no respect; he is merely a symbol of our occupation. It has been estimated that he will last 3 days if we withdraw. Our new allies should be the warlords and tribal leaders. Corruption is a fact of life in that region. The best we can expect on that front is that it be efficient or useful corruption; i.e. a situation where a significant share of the boodle is passed down to subordinates in order to help build cohesiveness within the faction.
To be sure, the situation may unavoidably descend then into intertribal chaos and warfare. We might be able to broker some kind of deal to prevent this (unlikely) or play some kind of mediating role as the conflict plays out. In any case we can maintain client relationships with warlords by providing money and arms.
This will inevitably tilt toward more effective relations with the northern part of the country and relatively more problems with the Pashtuns. Here we night benefit from stronger ties with Pakistan (Utopianly I wish that a Pashtunistan could be established, incorporating southern Afghanistan and the Tribal Areas, but the idiotic Durand line will be with us forever).
In the event, the Taliban will make great progress in the south, while little in the North. However, this should ensure at least that the Taliban will not be able to return to total rule. We should as well find some way to prevent the Taliban from taking over Kabul. With warlord help this is doable, even if Kabul is in Pashtun territory.
Further, an arrangement of this sort should permit us to keep monitoring and pursuing Al Qeada operatives, by means of drones or small injected ground forces.
The important point here is the difference between Vietnam and Afghanistan. We can withdraw from the utterly futile occupation while still retaining considerable influence.