<?xml version="1.0" encoding="US-ASCII" standalone="no"?>
    <!-- Field: Doc-Info; Name: Generator; Value: GoFiler Complete; Version: 5.18a -->
    <!-- Field: Doc-Info; Name: VendorURI; Value: https://www.novaworks.com -->
    <!-- Field: Doc-Info; Name: Status; Value: 0x00000000 -->
<link:linkbase xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:xbrldt="http://xbrl.org/2005/xbrldt" xmlns:xbrli="http://www.xbrl.org/2003/instance" xsi:schemaLocation="http://www.xbrl.org/2003/linkbase http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd">
    <link:roleRef roleURI="http://farmermac.com/role/Cover" xlink:href="agm-20221231.xsd#Cover" xlink:type="simple" />
    <link:roleRef roleURI="http://xbrl.sec.gov/ecd/role/PvpDisclosure" xlink:href="https://xbrl.sec.gov/ecd/2022q4/ecd-2022q4.xsd#PvpDisclosure" xlink:type="simple" />
    <link:roleRef roleURI="http://xbrl.sec.gov/ecd/role/PvpDisclosureWithAdditionalMeasures" xlink:href="https://xbrl.sec.gov/ecd/2022q4/ecd-2022q4.xsd#PvpDisclosureWithAdditionalMeasures" xlink:type="simple" />
    <link:roleRef roleURI="http://xbrl.sec.gov/ecd/role/PvpTable" xlink:href="https://xbrl.sec.gov/ecd/2022q4/ecd-2022q4.xsd#PvpTable" xlink:type="simple" />
    <link:roleRef roleURI="http://xbrl.sec.gov/ecd/role/PvpAdjustmentsToCompensation" xlink:href="https://xbrl.sec.gov/ecd/2022q4/ecd-2022q4.xsd#PvpAdjustmentsToCompensation" xlink:type="simple" />
    <link:roleRef roleURI="http://xbrl.sec.gov/ecd/role/TabularListsByExecutiveCategory" xlink:href="https://xbrl.sec.gov/ecd/2022q4/ecd-2022q4.xsd#TabularListsByExecutiveCategory" xlink:type="simple" />
    <link:roleRef roleURI="http://xbrl.sec.gov/ecd/role/TabularListMeasures" xlink:href="https://xbrl.sec.gov/ecd/2022q4/ecd-2022q4.xsd#TabularListMeasures" xlink:type="simple" />
    <link:roleRef roleURI="http://xbrl.sec.gov/ecd/role/PvpMeasures" xlink:href="https://xbrl.sec.gov/ecd/2022q4/ecd-2022q4.xsd#PvpMeasures" xlink:type="simple" />
    <link:roleRef roleURI="http://xbrl.sec.gov/ecd/role/PvpExecutiveCategoriesOnly" xlink:href="https://xbrl.sec.gov/ecd/2022q4/ecd-2022q4.xsd#PvpExecutiveCategoriesOnly" xlink:type="simple" />
    <link:roleRef roleURI="http://xbrl.sec.gov/ecd/role/PvpAdjustmentsOnly" xlink:href="https://xbrl.sec.gov/ecd/2022q4/ecd-2022q4.xsd#PvpAdjustmentsOnly" xlink:type="simple" />
    <link:roleRef roleURI="http://xbrl.sec.gov/ecd/role/IndividualsOnly" xlink:href="https://xbrl.sec.gov/ecd/2022q4/ecd-2022q4.xsd#IndividualsOnly" xlink:type="simple" />
    <link:roleRef roleURI="http://xbrl.sec.gov/ecd/role/ErrCompDisclosure" xlink:href="https://xbrl.sec.gov/ecd/2022q4/ecd-2022q4.xsd#ErrCompDisclosure" xlink:type="simple" />
    <link:roleRef roleURI="http://xbrl.sec.gov/ecd/role/ForgoneRecoveries" xlink:href="https://xbrl.sec.gov/ecd/2022q4/ecd-2022q4.xsd#ForgoneRecoveries" xlink:type="simple" />
    <link:roleRef roleURI="http://xbrl.sec.gov/ecd/role/OutstandingRecoveries" xlink:href="https://xbrl.sec.gov/ecd/2022q4/ecd-2022q4.xsd#OutstandingRecoveries" xlink:type="simple" />
    <link:roleRef roleURI="http://xbrl.sec.gov/ecd/role/Defaults" xlink:href="https://xbrl.sec.gov/ecd/2022q4/ecd-2022q4.xsd#Defaults" xlink:type="simple" />
    <link:arcroleRef xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#hypercube-dimension" arcroleURI="http://xbrl.org/int/dim/arcrole/hypercube-dimension" />
    <link:arcroleRef xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#dimension-domain" arcroleURI="http://xbrl.org/int/dim/arcrole/dimension-domain" />
    <link:arcroleRef xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#domain-member" arcroleURI="http://xbrl.org/int/dim/arcrole/domain-member" />
    <link:arcroleRef xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#all" arcroleURI="http://xbrl.org/int/dim/arcrole/all" />
    <link:arcroleRef xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#notAll" arcroleURI="http://xbrl.org/int/dim/arcrole/notAll" />
    <link:arcroleRef xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#dimension-default" arcroleURI="http://xbrl.org/int/dim/arcrole/dimension-default" />
    <link:definitionLink xlink:type="extended" xlink:role="http://farmermac.com/role/Cover" xlink:title="00000001 - Document - Cover" />
    <link:definitionLink xlink:type="extended" xlink:role="http://xbrl.sec.gov/ecd/role/PvpExecutiveCategoriesOnly" />
    <link:definitionLink xlink:type="extended" xlink:role="http://xbrl.sec.gov/ecd/role/PvpAdjustmentsOnly">
      <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/ecd/2022q4/ecd-2022q4.xsd#ecd_AllAdjToCompMember" xlink:label="loc_ecdAllAdjToCompMember" />
      <link:loc xlink:type="locator" xlink:href="agm-20221231.xsd#agm_CumulativeDeductionsFromSCTTotalMember" xlink:label="loc_agmCumulativeDeductionsFromSCTTotalMember" />
      <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_ecdAllAdjToCompMember" xlink:to="loc_agmCumulativeDeductionsFromSCTTotalMember" xlink:type="arc" order="0" />
      <link:loc xlink:type="locator" xlink:href="agm-20221231.xsd#agm_CumulativeAdditionsToSCTTotalMember" xlink:label="loc_agmCumulativeAdditionsToSCTTotalMember" />
      <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_ecdAllAdjToCompMember" xlink:to="loc_agmCumulativeAdditionsToSCTTotalMember" xlink:type="arc" order="10" />
      <link:loc xlink:type="locator" xlink:href="agm-20221231.xsd#agm_AggregateChangeInActuarialPresentValueIncludedInSctAmountsForCoveredFiscalYearMember" xlink:label="loc_agmAggregateChangeInActuarialPresentValueIncludedInSctAmountsForCoveredFiscalYearMember" />
      <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_ecdAllAdjToCompMember" xlink:to="loc_agmAggregateChangeInActuarialPresentValueIncludedInSctAmountsForCoveredFiscalYearMember" xlink:type="arc" order="20" />
      <link:loc xlink:type="locator" xlink:href="agm-20221231.xsd#agm_ServiceCostForCoveredFiscalYearMember" xlink:label="loc_agmServiceCostForCoveredFiscalYearMember" />
      <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_ecdAllAdjToCompMember" xlink:to="loc_agmServiceCostForCoveredFiscalYearMember" xlink:type="arc" order="30" />
      <link:loc xlink:type="locator" xlink:href="agm-20221231.xsd#agm_PriorServiceCostForCoveredFiscalYearMember" xlink:label="loc_agmPriorServiceCostForCoveredFiscalYearMember" />
      <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_ecdAllAdjToCompMember" xlink:to="loc_agmPriorServiceCostForCoveredFiscalYearMember" xlink:type="arc" order="40" />
      <link:loc xlink:type="locator" xlink:href="agm-20221231.xsd#agm_AggregateValueForStockAwardsAndOptionAwardsIncludedInSctAmountsForCoveredFiscalYearMember" xlink:label="loc_agmAggregateValueForStockAwardsAndOptionAwardsIncludedInSctAmountsForCoveredFiscalYearMember" />
      <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_ecdAllAdjToCompMember" xlink:to="loc_agmAggregateValueForStockAwardsAndOptionAwardsIncludedInSctAmountsForCoveredFiscalYearMember" xlink:type="arc" order="50" />
      <link:loc xlink:type="locator" xlink:href="agm-20221231.xsd#agm_FairValueAtYearEndOfAwardsGrantedDuringCoveredFiscalYearThatWereOutstandingAndUnvestedAtCoveredFiscalYearEndMember" xlink:label="loc_agmFairValueAtYearEndOfAwardsGrantedDuringCoveredFiscalYearThatWereOutstandingAndUnvestedAtCoveredFiscalYearEndMember" />
      <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_ecdAllAdjToCompMember" xlink:to="loc_agmFairValueAtYearEndOfAwardsGrantedDuringCoveredFiscalYearThatWereOutstandingAndUnvestedAtCoveredFiscalYearEndMember" xlink:type="arc" order="60" />
      <link:loc xlink:type="locator" xlink:href="agm-20221231.xsd#agm_YearOverYearChangeInFairValueAtCoveredFiscalYearEndOfAwardsGrantedInAnyPriorFiscalYearThatWereOutstandingAndUnvestedAtCoveredFiscalYearEndMember" xlink:label="loc_agmYearOverYearChangeInFairValueAtCoveredFiscalYearEndOfAwardsGrantedInAnyPriorFiscalYearThatWereOutstandingAndUnvestedAtCoveredFiscalYearEndMember" />
      <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_ecdAllAdjToCompMember" xlink:to="loc_agmYearOverYearChangeInFairValueAtCoveredFiscalYearEndOfAwardsGrantedInAnyPriorFiscalYearThatWereOutstandingAndUnvestedAtCoveredFiscalYearEndMember" xlink:type="arc" order="70" />
      <link:loc xlink:type="locator" xlink:href="agm-20221231.xsd#agm_VestingDateFairValueOfAwardsGrantedAndVestedDuringCoveredFiscalYearMember" xlink:label="loc_agmVestingDateFairValueOfAwardsGrantedAndVestedDuringCoveredFiscalYearMember" />
      <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_ecdAllAdjToCompMember" xlink:to="loc_agmVestingDateFairValueOfAwardsGrantedAndVestedDuringCoveredFiscalYearMember" xlink:type="arc" order="80" />
      <link:loc xlink:type="locator" xlink:href="agm-20221231.xsd#agm_ChangeAsOfVestingDateFromEndOfPriorFiscalYearInFairValueOfAwardsGrantedInAnyPriorFiscalYearForWhichVestingConditionsWereSatisfiedDuringCoveredFiscalYearMember" xlink:label="loc_agmChangeAsOfVestingDateFromEndOfPriorFiscalYearInFairValueOfAwardsGrantedInAnyPriorFiscalYearForWhichVestingConditionsWereSatisfiedDuringCoveredFiscalYearMember" />
      <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_ecdAllAdjToCompMember" xlink:to="loc_agmChangeAsOfVestingDateFromEndOfPriorFiscalYearInFairValueOfAwardsGrantedInAnyPriorFiscalYearForWhichVestingConditionsWereSatisfiedDuringCoveredFiscalYearMember" xlink:type="arc" order="90" />
      <link:loc xlink:type="locator" xlink:href="agm-20221231.xsd#agm_FairValueAtEndOfPriorFiscalYearOfAwardsGrantedInAnyPriorFiscalYearThatFailedToMeetApplicableVestingConditionsDuringCoveredFiscalYearMember" xlink:label="loc_agmFairValueAtEndOfPriorFiscalYearOfAwardsGrantedInAnyPriorFiscalYearThatFailedToMeetApplicableVestingConditionsDuringCoveredFiscalYearMember" />
      <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_ecdAllAdjToCompMember" xlink:to="loc_agmFairValueAtEndOfPriorFiscalYearOfAwardsGrantedInAnyPriorFiscalYearThatFailedToMeetApplicableVestingConditionsDuringCoveredFiscalYearMember" xlink:type="arc" order="100" />
      <link:loc xlink:type="locator" xlink:href="agm-20221231.xsd#agm_DividendsOrOtherEarningsPaidOnStockOrOptionAwardsInCoveredFiscalYearPriorToVestingIfNotOtherwiseIncludedInTotalCompensationForCoveredFiscalYearMember" xlink:label="loc_agmDividendsOrOtherEarningsPaidOnStockOrOptionAwardsInCoveredFiscalYearPriorToVestingIfNotOtherwiseIncludedInTotalCompensationForCoveredFiscalYearMember" />
      <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_ecdAllAdjToCompMember" xlink:to="loc_agmDividendsOrOtherEarningsPaidOnStockOrOptionAwardsInCoveredFiscalYearPriorToVestingIfNotOtherwiseIncludedInTotalCompensationForCoveredFiscalYearMember" xlink:type="arc" order="110" />
    </link:definitionLink>
    <link:definitionLink xlink:type="extended" xlink:role="http://xbrl.sec.gov/ecd/role/IndividualsOnly">
      <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/ecd/2022q4/ecd-2022q4.xsd#ecd_AllIndividualsMember" xlink:label="loc_ecdAllIndividualsMember" />
      <link:loc xlink:type="locator" xlink:href="agm-20221231.xsd#agm_Peo1Member" xlink:label="loc_agmPeo1Member" />
      <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_ecdAllIndividualsMember" xlink:to="loc_agmPeo1Member" xlink:type="arc" order="0" />
    </link:definitionLink>
</link:linkbase>
