Help with agent

Hi

I have an employee database, that runs an agent, which create new documents if it finds a new user in names.nsf. The agent takes certain fields from names.nsf including unid and sets it in the employee database.

I would like to create an agent which compares unid from person records in names.nsf and compares with the employee records which has a field for unid from names.nsf. If it is a match it should take field values from names.nsf and write it to the employee record.

Can anybody help?