"This is a historic moment the Libyans were waiting for, the Arabs were waiting for and the world was waiting for," said Awad Mohammed Abdul-Sadiq, the first deputy head of the Tripoli-based General National Congress (GNC).
GNC officials had been holding talks in the suburbs of Tunis for several days with delegates from the internationally recognised House of Representatives.
Abdul-Sadiq called on Libyans to support what he called "a historic opportunity".
Signup to our newsletter and follow us on Facebook and Twitter!
"If this solution receives real Libyan support -- from the people and institutions -- we will surely arrive in no more than two weeks or a month to a solution to solve the political crisis," he told a press conference.
Amna Emtair from the GNC delegation told AFP the agreement would set up a new representative body that would choose a committee to nominate a prime minister within 15 days, while another committee would conduct a review of Libya's constitution.
"It is a major breakthrough," Emtair said.
Libya descended into chaos after the October 2011 ouster and killing of longtime dictator Kadhafi, with two governments vying for power and armed groups battling for control of its vast energy resources.
A militia alliance including Islamists overran Tripoli in August 2014, establishing a rival government and a parliament that forced the internationally recognised administration to flee to the country's remote east.