code: func NewLocalAgent(keyDir string, proxyHost string, username string) (a *LocalKeyAgent, err error) {
  	keystore, err := NewFSLocalKeyStore(keyDir)
  	if err != nil {
  		return nil, trace.Wrap(err)
  	}
  
  	a = &LocalKeyAgent{
  		log: logrus.WithFields(logrus.Fields{
  			trace.Component: teleport.ComponentKeyAgent,
  		}),
  		Agent:     agent.NewKeyring(),
  		keyStore:  keystore,
  		sshAgent:  connectToSSHAgent(),
  		noHosts:   make(map[string]bool),
  		username:  username,
  		proxyHost: proxyHost,
  	}
  
  	// unload all teleport keys from the agent first to ensure
  	// we don't leave stale keys in the agent
  	err = a.UnloadKeys()
  	if err != nil {
  		return nil, trace.Wrap(err)
  	}
  
  	// read in key for this user in proxy
  	key, err := a.GetKey()
  	if err != nil {
  		if trace.IsNotFound(err) {
  			return a, nil
  		}
  		return nil, trace.Wrap(err)
  	}
  
  	a.log.Infof("Loading key for %q", username)
  
  	// load key into the agent
  	_, err = a.LoadKey(*key)
  	if err != nil {
  		return nil, trace.Wrap(err)
  	}
  
  	return a, nil
  }
docs: // NewLocalAgent reads all Teleport certificates from disk (using FSLocalKeyStore),
  // creates a LocalKeyAgent, loads all certificates into it, and returns the agent.