Skip to main content

Dendrite is a suite of tools that makes it easy to create web integrations for AI agents. With Dendrite your can: Authenticate on websites, Interact with elements, Extract structured data, Download and upload files, Fill out forms

Project description

Dendrite Homepage Docs Discord

🎉We are going open source🎉

Let us know if you're interested in contributing!

What is Dendrite?

Dendrite is a framework that makes it easy for web AI agents to browse the internet just like humans do. Use Dendrite to:

  • 👆🏼 Interact with elements
  • 💿 Extract structured data
  • 🔓 Authenticate on websites
  • ↕️ Download/upload files
  • 🚫 Browse without getting blocked

A simple outlook integration

With Dendrite, it's easy to create web interaction tools for your agent.

from dendrite import Dendrite

def send_email():
    client = Dendrite(auth="outlook.live.com")

    # Navigate
    client.goto(
        "https://outlook.live.com/mail/0/",
        expected_page="An email inbox"
    )

    # Create new email and populate fields
    client.click("The new email button")
    client.fill_fields({
        "Recipient": to,
        "Subject": subject,
        "Message": message
    })

    # Send email
    client.click("The send button")

To authenticate you'll need to use our Chrome Extension Dendrite Vault, you can download it here. Read more about authentication in our docs.

Quickstart

pip install dendrite && dendrite install

Simple navigation and interaction

Initialize the Dendrite client and start doing web interactions without boilerplate.

Get your API key here

from dendrite import Dendrite

client = Dendrite(dendrite_api_key="sk...")

client.goto("https://google.com")
client.fill("Search field", "Hello world")
client.press("Enter")

In the example above, we simply go to Google, populate the search field with "Hello world" and simulate a keypress on Enter. It's a simple example that starts to explore the endless possibilities with Dendrite. Now you can create tools for your agents that have access to the full web without depending on APIs.

More powerful examples

Now, let's have some fun. Earlier we showed you a simple send_email example. And sending emails is cool, but if that's all our agent can do it kind of sucks. So let's create two cooler examples.

Download Bank Transactions

First up, a tool that allows our AI agent to download our bank's monthly transactions so that they can be analyzed and compiled into a report that can be sent to stakeholders with send_email.

from dendrite import Dendrite

def get_transactions() -> str:
    client = Dendrite(auth="mercury.com")

    # Navigate and wait for loading
    client.goto(
      "https://app.mercury.com/transactions",
      expected_page="Dashboard with transactions"
    )
    client.wait_for("The transactions to finish loading")

    # Modify filters
    client.click("The 'add filter' button")
    client.click("The 'show transactions for' dropdown")
    client.click("The 'this month' option")

    # Download file
    client.click("The 'export filtered' button")
    transactions = client.get_download()

    # Save file locally
    path = "files/transactions.xlsx"
    transactions.save_as(path)

    return path

def analyze_transactions(path: str):
    ...

Extract Google Analytics

Finally, it would be cool if we could add the amount of monthly visitors from Google Analytics to our report. We can do that by using the extract function:

def get_visitor_count() -> int:
    client = Dendrite(auth="analytics.google.com")

    client.goto(
      "https://analytics.google.com/analytics/web",
      expected_page="Google Analytics dashboard"
    )

    # The Dendrite extract agent will create a web script that is cached
    # and reused. It will self-heal when the website updates
    visitor_count = client.extract("The amount of visitors this month", int)
    return visitor_count

Documentation

Read the full docs here

Find more advanced examples in our docs.

Remote Browsers

When you want to scale up your AI agents, we support using browsers hosted by Browserbase. This way you can run many agents in parallel without having to worry about the infrastructure.

To start using Browserbase just swap out the Dendrite class with DendriteRemoteBrowser and add your Browserbase API key and project id, either in the code or in a .env file like this:

# ... previous keys
BROWSERBASE_API_KEY=
BROWSERBASE_PROJECT_ID=
# from dendrite import Dendrite
from dendrite import DendriteRemoteBrowser

...

# client = Dendrite(...)
client = DendriteRemoteBrowser(
    # Use interchangeably with the Dendrite class
    browserbase_api_key="...", # or specify the browsebase keys in the .env file
    browserbase_project_id="..."
)

...

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

dendrite-0.2.7.tar.gz (74.3 kB view details)

Uploaded Source

Built Distribution

dendrite-0.2.7-py3-none-any.whl (124.5 kB view details)

Uploaded Python 3

File details

Details for the file dendrite-0.2.7.tar.gz.

File metadata

  • Download URL: dendrite-0.2.7.tar.gz
  • Upload date:
  • Size: 74.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for dendrite-0.2.7.tar.gz
Algorithm Hash digest
SHA256 bb262650785fbdc8fede09d60c10c4b82b37311bbd38adc82945a38ebc44c5ea
MD5 c732d6a7a188f763e35723721d89c2a6
BLAKE2b-256 99b87d7b98edb18800a44532030544b82b583acc1cae160e6dee08cec6b914b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for dendrite-0.2.7.tar.gz:

Publisher: python-publish.yml on dendrite-systems/dendrite-python-sdk

Attestations:

File details

Details for the file dendrite-0.2.7-py3-none-any.whl.

File metadata

  • Download URL: dendrite-0.2.7-py3-none-any.whl
  • Upload date:
  • Size: 124.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for dendrite-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 96ce8fbb7cf78e8eb9e657169a2a566f1964d1eb381b1c83f7d4220625d969cb
MD5 fc88c7e809f282ded5d1618aa56ad693
BLAKE2b-256 8a4219c3922e91bd582e1ef9df3499d6ae174b081f88e68778967394fad66404

See more details on using hashes here.

Provenance

The following attestation bundles were made for dendrite-0.2.7-py3-none-any.whl:

Publisher: python-publish.yml on dendrite-systems/dendrite-python-sdk

Attestations:

Supported by

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