<?xml version="1.0"?>
<ownershipDocument>

    <schemaVersion>X0508</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2024-12-02</periodOfReport>

    <issuer>
        <issuerCik>0001653087</issuerCik>
        <issuerName>Alector, Inc.</issuerName>
        <issuerTradingSymbol>ALEC</issuerTradingSymbol>
    </issuer>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001748894</rptOwnerCik>
            <rptOwnerName>GRASSO MARC</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>C/O ALECTOR, INC.</rptOwnerStreet1>
            <rptOwnerStreet2>131 OYSTER POINT BLVD., SUITE 600</rptOwnerStreet2>
            <rptOwnerCity>SOUTH SAN FRANCISCO</rptOwnerCity>
            <rptOwnerState>CA</rptOwnerState>
            <rptOwnerZipCode>94080</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>false</isDirector>
            <isOfficer>true</isOfficer>
            <isTenPercentOwner>false</isTenPercentOwner>
            <isOther>false</isOther>
            <officerTitle>Chief Financial Officer</officerTitle>
        </reportingOwnerRelationship>
    </reportingOwner>

    <aff10b5One>false</aff10b5One>

    <nonDerivativeTable>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <transactionDate>
                <value>2024-12-02</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>S</transactionCode>
                <equitySwapInvolved>false</equitySwapInvolved>
                <footnoteId id="F1"/>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>16489</value>
                </transactionShares>
                <transactionPricePerShare>
                    <value>2.5194</value>
                    <footnoteId id="F2"/>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>D</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>330651</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
    </nonDerivativeTable>

    <footnotes>
        <footnote id="F1">The reported shares were sold to satisfy the reporting person's tax obligations in connection with the vesting of restricted stock units, or RSUs.</footnote>
        <footnote id="F2">The price reported in Column 4 is a weighted average price. The shares were sold in multiple transactions at prices ranging from $2.5193 to $2.5195. Full information regarding the number of shares sold at each separate price can be furnished to the SEC staff, the issuer, or any security holder of the issuer upon request.</footnote>
    </footnotes>

    <ownerSignature>
        <signatureName>/s/ Marc Grasso</signatureName>
        <signatureDate>2024-12-03</signatureDate>
    </ownerSignature>
</ownershipDocument>
