America needs to leave behind a program for humanitarian aid-clean drinking water, sanitary water, food aid, agricultural training,medicine, hospitals, schools. And more of a focus on diplomacy and what would benefit the Afghan people -values and interests- in accord with American values and interests. This could be cheaper and more effective than the militray option.
The Taliban which is all Pashtun even though not all Pashtuns are Taliban will have enrmous influence. A plurality of Afghans are Pashtun along with 15% of Pakistanis.
Walking the ethnic tribal tightrope between the Pahstuns and the Tajiks, Uzbeks, etc will be tough. A slow simmering civil war would be better than all out war. Expulsion of the foreign jihadists and controlling the ethnic warlords and drug dealers will be tough.
The number of Afghans killed, wounded and displaced in this war will continue to haunt us. Avoiding another haven for terrorists is in America's interest.
Determining what went wrong and right and why will take time. But it is necessary. The cost in blood, treasure and time in this war is still unknown.