The switch-hitting Miles batted .317 with four homers and 31 RBIs in 134 games for the St. Louis Cardinals last season.
"We expect Aaron to provide significant versatility and flexibility to our roster," Cubs general manager Jim Hendry said.
Last season Miles played mostly at second base with 85 appearances. He also played short, third and all three outfield positions.
In 643 major league games, the 32-year-old Miles has a career average of .289. He has also played with the White Sox and Rockies.
Miles was originally selected by the Houston Astros in the 19th round of the 1995 draft.
"I want to play the game the right way and show St. Louis they let somebody go that maybe they shouldn't have," Miles said during a conference call
"I was a little surprised given the situation and how well I did last year. I felt I was part of the team. Financially I understand why they did it. It was still kind of shocking. I felt I had a place over there."
Shortly after they announced the agreement with Miles, the Cubs traded second baseman Mark DeRosa to the Cleveland Indians.
"I feel confident we'll add another hitter in the outfield in the next week or two weeks," Hendry said. "I've always felt confident in that and I still do. Once that player is acquired, the position players will start to shape up."