D.B. Hardeman, 67, an aide to fomer House Speaker Sam Rayburn (D-Tex.) who became a legend as a mentor in the education of reporters, staff members and political scientists interested in the workings of Capitol Hill, died Thursday in a hospital in San Antonio, Tex., after a heart attack. He had moved to San Antonio from Washington about three years ago.

Mr. Hardeman came to Washington in 1956 with plans to write a book on the life and times of Speaker Rayburn, who served as speaker of the House of Representatives for all but four years between 1940 and 1961. Shortly after he began interviewing Rayburn for the book, Rayburn hired him.

From 1956, until Rayburn's death in 1961, Mr. Hardeman filled a variety of roles for the speaker. His title was legislative assistant, but his role with Rayburn was that of personal confidant, political adviser, and friend.

Rayburn was famous for his "board of education," a gathering of powerful congressmen, White House officials, and friends who gathered at the end of working days in a hide-away office in the House. They met to negotiate bills, trade information and stories, and quaff bourbon.

Mr. Hardeman established his own organization, the "board of ignorance," a more gregarious organization also tucked in a House room and dedicated to the similar pursuits of drink and information.

Paul Duke, then covering Congress for the Wall Street Journal, remembered that those who took part in Mr. Hardeman's board were young reporters, staffers, and a few very junior congressman. Meetings consisted of Mr. Hardeman explaining the sometime Byzantine workings of the House, tipping reporters on what to watch for, and relating some of the better political stories of the day. Along the way, he helped educate a generation of Washington reporters.

Following Rayburn's death, Mr. Hardeman spent several years as an administrative assistant to the late Hale Boggs (D-La.) when Boggs was House Democratic Whip.

Mr. Hardeman was long active in Democratic politics in Texas and Washington. Twice elected to the Texas House, he helped lead the presidential efforts of Adlai E. Stevenson Jr., in 1952 and again in 1956. Four years later, he was an advance man with the Kennedy-Johnson ticket. In 1964, Mr. Hardeman was a member of Lyndon Johnson's "Five O'Clock Club," a strategy organization that met about that time of day to plan the presidential campaign.

In later years, Mr. Hardeman was even more active in educational endeavors. He taught courses in political science at Trinity College in Washington and at the University of Texas in San Antonio. Even while he had worked on the Hill, Mr. Hardeman had been active in the American Political Science Association's congressional fellowship program since the early 1960s, and also worked with the Washington program of UCLA. He also had lectured with the Brookings Institution.

Mr. Hardeman donated a room of books on government to the Lyndon Johnson Library in Auston. The library gives a biennual D.B. Hardeman Award for the best book on political science.

Mr. Hardeman was reared on a cattle ranch near Goliad, Tex., and gained a reputation as a speed-reader and a lad who loved history. He entered the University of Texas at the age of 15, where he earned a bachelor's degree in English and a law degree and edited the school's daily newspaper.

During World War II, he served an Army counterintelligence officer in Europe and the Mediterranean, and attained the rank of major. After the war, he returned to Texas and managed the unsuccessful gubernatorial race of Dr. Homer Rainey in 1946.

Mr. Hardeman was elected to the Texas House in 1950, and was the architect of a succesful bill that put a tax on oil pipelines. A colleague of those days, Maury Maverick Jr., said that Mr. Hardeman's tax bill passed where others failed because Mr. Hardeman's bill specified that revenue from the bill would go to county road construction, hospitals, and teacher salaries.

Opposed by the oil and gas lobby, Mr. Hardeman was defeated in his reelection bid in 1952. Two years later, he won election to a second term, retiring from the legislature in 1956.

He leaves no immediate survivors.