Skip to main content

Haystack 2.x component that ingests Salesforce Nonprofit Success Pack (NPSP) donor data as Documents for RAG.

Project description

Haystack — Salesforce NPSP

A Haystack 2.x component that ingests Salesforce Nonprofit Success Pack (NPSP) donor data as Documents for RAG pipelines — no Airbyte, no CDK.

Unlike a raw Salesforce connector, this is NPSP-aware: it understands npo02__ and npsp__ field prefixes and emits human-readable donor summaries (giving totals, gift history, engagement) instead of raw JSON.

Installation

pip install haystack-salesforce-npsp

Credentials

export SF_USERNAME="you@yourorg.org"
export SF_PASSWORD="your_password"
export SF_TOKEN="your_security_token"

Usage

from haystack import Pipeline
from haystack.components.embedders import SentenceTransformersDocumentEmbedder
from haystack.document_stores.in_memory import InMemoryDocumentStore
from haystack.components.writers import DocumentWriter
from haystack_salesforce_npsp import SalesforceNPSPFetcher

store = InMemoryDocumentStore()

indexing = Pipeline()
indexing.add_component("fetch", SalesforceNPSPFetcher(
    soql_filter="npo02__TotalOppAmount__c > 5000",
    limit=500,
))
indexing.add_component("embed", SentenceTransformersDocumentEmbedder())
indexing.add_component("write", DocumentWriter(document_store=store))
indexing.connect("fetch.documents", "embed.documents")
indexing.connect("embed.documents", "write.documents")

indexing.run({})

Each Document has:

  • .content — narrative donor profile (name, giving summary, recent gifts)
  • .meta — structured donor fields (donor_id, total_gift_amount, gift_count, affiliation, source="salesforce_npsp", …)

Affinity scores

Pass a callable (meta: dict) -> float as affinity_score_fn to inject an ML-derived donor propensity score into every document's metadata at fetch time.

SalesforceNPSPFetcher(affinity_score_fn=lambda m: min(50 + m["total_gift_amount"] / 5000, 100))

Note: because affinity_score_fn is an arbitrary callable, a fetcher configured with one is not YAML-serializable. Instantiate it in Python.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

haystack_salesforce_npsp-0.1.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

haystack_salesforce_npsp-0.1.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file haystack_salesforce_npsp-0.1.0.tar.gz.

File metadata

  • Download URL: haystack_salesforce_npsp-0.1.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for haystack_salesforce_npsp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a4ba7f4b54627ec41979bdfb966ba22d012bab8b970fdf1aef695e601ceefb61
MD5 729029bf202971e715f6bae51d72906b
BLAKE2b-256 515f57bbb545d82fbaf1547ce32895bb73fbd7d0796587e081f3f088c1f088be

See more details on using hashes here.

Provenance

The following attestation bundles were made for haystack_salesforce_npsp-0.1.0.tar.gz:

Publisher: publish.yml on PhilanthroPy-Project/salesforce-npsp-integrations

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file haystack_salesforce_npsp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for haystack_salesforce_npsp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d7ce055b7d89178b2472bfbb17bf2354c2396dc5cd219c1fd1da8d6e2c861069
MD5 f2236eee3babf248849e0619aa475ec7
BLAKE2b-256 cb5f15a20c2bf7886bb4cf055b83fb63965fcbcd6e4bd6a1c846365c7987688f

See more details on using hashes here.

Provenance

The following attestation bundles were made for haystack_salesforce_npsp-0.1.0-py3-none-any.whl:

Publisher: publish.yml on PhilanthroPy-Project/salesforce-npsp-integrations

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page