Andrew P. Miller, who narrowly lost the Democratic nomination for governor of Virginia last month, became a partner today in a large Richmond law firm.

At a news conference at the State Capitol, Miller said he has joined Mays, Valentine, Davenport and Moore, one of the largest law firms in the state.

He said that joining the firm does not preclude his return to politics, but added that he has not made a decision about running for office again.

When Miller was defeated by former Lt. Gov. Henry E. Howell for the nomination for governor on June 14, his name was immediately added to the long list of potential Democratic candidates to succeed Republican U.S. Sen. William L. Scott, who has announced that he will not run for re-election next year.

Miller, 44, was attorney general of Virginia from 1970 until he resigned last January to run for governor. The Association of State Attorneys General named him the outstanding attorney general in the nation in 1976.

He practiced law in Abingdon, Va., for seven years before running for attorney general in 1969. He had graduated first in his class from the University of Virginia Law School.

Among the partners in the firm he is joining are two other Virginia political figures, John O. Marsh, former Seventh District congressman and adviser to former President Ford, and Angus H. Macaulay, Third District Democratic chairman. Marsh practices in Mays, Valentine's Washington office.