In the beginning, there is guilt. Somebody done somebody wrong. In the end, there is in the world of the cinematic detective, hard-boiled or otherwise, a world the American Film Institute will be entering as its own risk in a 50-film series called "Without?" opening Wednesday. Existing in an atmosphere drenched in evil, the detective tries to make it all right. As tough cop Kirk Douglas, wonderfully young and vibrant, puts it in "Detective Story," "This is one business that never has a depression."

Somewhere, somehow, there is usually a woman involved. Maybe she hires the detective for protection. Maybe she wants to kill him. Maybe he feels the same about her. One way or another, sparks will fly. If you get my meaning. If you catch my dirft.

Not all detectives are tough guys, at least on the surface. Sure, some are hard cases who dispatch hooligans with eclat, but others are suave, superintellectual types that slinky women find irresistable. The best of the bunch are like the gentleman Raymond Chandler, who did as much for the detectives as the designer of the trench coat, called "a man of honor - by instinct, by inevitability, without thought of it and certainly without saying it . . . If there were enough like him, the world would be safe place to live in, without becoming too dull to be worth living in."

If the AFI selection is any judge, some of the most unlikely people have had a hand in detective films. Gracie Allen, for instance, gets to do whatever it is she does in "The Gracie Allen Murder Case," while Japanese director Akira Kurosawa and actor Toshiro Mifune, best known for their samurai epics, turn up with one of the most suspenseful of modern detective films, "High and Low," where the plot turns on a kidnapping gone astray.

The unlikeliest detective of all, however, is Buster Keaton in "Sherlock Jr." Keaton isn't really a detective at all, but rather a movie projectionist who dreams himself into a criminal situation. Little more than an hour in length, "Sherlock" features some of the funniest bits Keaton or anyone else ever did, including a surrealistic series of sight gags that unnerve the mind ahe fact.(See MYSTERY, K2, Col. 1) (MYSTERY, From K1)

Yet despite this seeming disparity, detectives, both in novels and on film, divide quite easily into two camps. First come the cerbral types, the deductive thinkers, who rarely if ever still their hands with fisticuffs. Operators like Sherlock Holmes, here represented by two actors and three films, and the ineffable oriental, Charlie Chan, who even "At the Opera" manages his usual trick of herding the biggest crowd of suspects into the smallest rooms of any detective going. And, of course, actor William Powell, suave enough to be two detectives, both Philo Vance in "The Kennel Murder Case" and Nick Charles, better known as "The Thin Man."

Erudition, however, can get on everyone's nerves, and soon there was a movement, as Raymond Chandler os nicely put it, "to get murder away from the upper classes, the weekend house party and the vicar's roe who are really good at it." And so the hardboiled school of detection opened for business.

Chandler and Dashiell Hammett were of course the prize pupils, and if you don't count the films they inspired, like Albert Finney's "Gumshoe," the pair is involved in seven of AFT's offerings. Hammett fans can resee "The Maltese Falcon" with Humphrey Bogart, try an earlier version with Ricardo Cortez as Sam Spade and Bebe Daniels as the fatal Miss Wonderly, or take a chance on the dream team of Alan Ladd and Veronica Lake in "The Glass Key." Chandlerites meanwhile have a choice of no less than four interpretations of that tarnished knight, Philip Marlowe, ranging from the classic (Bogart again in "The Big Sleep" and Dick Powell in "Murder My Sweet") to the adequate (Robert Mitchum in "Farewell, My Lovely") to the wretched (Elliot Gould in "The Long Goodbye.") Chandler's personal choice for the ideal Marlowe was Cary Grant, which shows you how much he knew.

The most interesting of the hardboiled films fall under the category known as film noir, films that are marked both physically and emotionally by dark, terribly corrosive shadows, films that overflow with evil and discontent. Fortunately, two of the really classic noirs, "Out of the Past" and "Kiss Me Deadly," are on the AFI series.

"Out of the Past" has a criminally handsome Robert Mitchum, a man who's seen "one place too many," brooding in a trenchcoat while trying to decide what he thinks about bad but beautiful Kathi Moffat (Jane Greer). "Get out," he tells her at one point, "I have to sleep in this room."

"Kiss Me Deadly," on the other hand, is a film which sim ply erupts off the screen. Featuring Ralph Meeker as the brutally psychotic Mike Hammer, "a midget among dwarfs," says one critic, this is possibly the best movie director Robert Aldrich - who is scheduled to attend the Feb. 4 screening - ever made. Unforgettable, especially at the end.

Two other noir oddities also should be noticed. The first are the films of Laird Cregar, an actor of enormous bulk and presence who died of a heart attack at age 28, apparently the victim of a crash diet. Three of his films are sheduled, including the gem-like "The Lodger," where Cregar brings a marvelous sense of collosal menace to the role of Jack the Ripper.

And then there is Edgar G. Ulmer's "Detour." Ulmer is a legend among film fanatics, a man who could make films in six days like nobody's business. "Detour," which on e critic called "an exercise in sustained perversity" with a story that is "beneath trash." is one of the cheapest movies ever made, and, with most of the action taking place behind a car windshield, it looks it. Yet, one cannot but stand in awe of "Detour's" harsh, hate-filled atmosphere, its endless laconic desperation. It's lead actor. Tom Neal, later went to prison for killing his wife, causing Ulmer to comment, "He did practically the same thing he did in the picture."

See this one at your own risk.