"You get the right guys to play the right things at the right time and you got a motherfucker," Miles Davis said of the highly innovative and cohesive quintet he led between 1964 and 1968. Now comes the definitive collection of this period of his intense musical growth: The Miles Davis Quintet, 1965-68: The Complete Columbia Studio Recordings. Following in the wake of Miles Davis and Gil Evans: The Complete Columbia Studio Recordings, which won an unprecedented three Grammy awards, this boxed set of six CDs collects all the group's work, with the exception of their live recordings, and amounts to a colossal 440 minutes of music.

The songs, which are presented chronologically, from January 1965 to June 1968, include all the music from the albums ESP, Miles Smiles, Sorcerer, Nefertiti, Miles in the Sky and three songs from Filles de Kilimanjaro. Other songs that were recorded during this stage but only released on the albums Water Babies, Circle in the Round and Directions, in 1976, 1979 and 1981 respectively, are also incorporated. The inclusion of 13 previously unreleased versions of various recordings gives this collection an authoritative weight.

After the artistic and commercial success of his collaborations with Gil Evans in the late Fifties and early Sixties, Miles Davis sank into a musical lull. He performed only his most popular songs at an increasingly rapid pace. When Wynton Kelly, Paul Chambers and Jimmy Cobb resigned from his band in 1963, Davis began the difficult, intricate task of building a compact new group.

The inclusion of Wayne Shorter was crucial. Strongly affected by John Coltrane, who had stopped recording with Miles Davis in 1960, the saxophonist had worked with Art Blakey and the Jazz Messengers for four years, excelling as a composer.

Davis believed that Shorter readily joined his group because "he wanted to play freer than he could in Art's band, but he didn't want to be all the way out, either". Davis, himself was not overly fond of freeform jazz and accused its practitioners of being "used by all those white critics". Over the next four years, the group would thrive in the area between bop and the more avant garde strains of jazz.

The pianist, Herbie Hancock, had moved to New York to work with Donald Byrd and performed as a session musician on many albums for Blue Note Records. Davis described both him and the bass player, Ron Carter, as the band's "anchors".

It was the saxophonist Jackie McLean who suggested that Davis check out a teenage drumming prodigy called Tony Williams.

Davis, who admitted he heard the influence of Blakey, Philly Joe Jones, Roy Haynes and Max Roach in his playing, explained: "Tony played on top of the beat, just a fraction above, and it gave everything a little edge." It was Williams who Davis would predominantly react to, musically, when they recorded or performed.

The musical affinity that existed between the musicians was phenomenal and, although Davis called himself the "inspiration and wisdom and the link for this band", he confessed: "I knew that I was playing with some great young musicians who had their fingers on a different pulse."

ESP, recorded in January 1965, demonstrated Davis's desire to escape from fixed chorus lengths. The first song and title track, written by Shorter, is, fittingly, a joyful burst of energy. "Iris", "Little One" and "Mood" are delicate, fascinating ballads that suggest the influence Evans had on Hancock and testify to Davis's willingness to include songs composed by his musicians.

Due to an arthritic hip and a liver infection, Davis did not record the follow-up album, Miles Smiles until October 1966. The LP united the group and Davis sensed this, saying: "You really hear us pulling away musically, stretching out." The record includes "Freedom Jazz Dance", by Eddie Harris, and "Gingerbread Boy", which was written by Jimmy Heath, one of the saxophonists Davis had considered before hiring Shorter. Shorter himself contributed three songs, including the mesmerising "Footprints", which he originally recorded on his own album, Adam's Apple.

Shorter had been concerned that Davis would limit his input as a composer, but on the albums, Sorcerer and Nefertiti, both recorded over the summer of 1967, he blossomed as a writer.

The fourth CD of the boxed set contains an hypnotic 33-minute version of Circle in the Round, previously unreleased at this length. The song has a organic quality and the incorporation of the guitar, chimes and celeste, played by Joe Beck, Davis and Hancock respectively, suggests the fresh direction that Davis was assuming.

Coltrane had died in 1967 and his death pushed freeform jazz into confusion. During this period, Davis was beginning to include traces of rock and pop within his work. He admired the way James Brown used guitar and this explains the presence of both Beck and Bucky Pizzarelli. The latter played the guitar on the song "Fun", on which Hancock experimented with the electric harpsicord.

Miles in the Sky was recorded in January and May, 1968. Davis was unsatisfied with the work of Beck and replaced him with George Benson, who plays the guitar on "Paraphernalia" and two other songs.

Davis imbued his song "Stuff" with elements found in contemporary soul music, and the performances of Hancock and Carter, on the electric piano and the electric bass guitar, only emphasised this quality. In his autobiography, Davis wrote: "Moving into electrical instruments would break up my band ... and send me into a new kind of music."

In June 1968, the quintet recorded three songs for Filles de Kilimanjaro before both Hancock and Carter departed, dissolving the group. When the album was released, the cover bore a photograph of Betty Mabry, whom Davis had married in September 1968. She was a musician herself, and would introduce Davis to Jimi Hendrix. Her presence is symbolic of the musical path the restless Davis would now be forging.

The Miles Davis Quintet, 1965-68: The Complete Columbia Studio Recordings is released on 23 March.