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

Read the full docs here

What is Dendrite?

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

For example, if you want to create an AI agent that can log into your bank and analyze it's cashflow, it would be easy to create an analyze_cashflow action with Dendrite!

Get your API keys

First, let's get an Dendrite API key from the dashboard.

You'll also need an OpenAI and Anthropic API key. We use their LLMs to complete certain task, so make sure you have valid API keys.

You can use the keys in your code or have them in a .env file like this:

OPENAI_API_KEY=
ANTHROPIC_API_KEY=
DENDRITE_API_KEY=

Installation

Install the Dendrite SDK. We also need to run playwright install to install the browser drivers.

With pip:

pip install dendrite-sdk && playwright install 

With poetry:

poetry add dendrite-sdk && poetry run playwright install 

Hello World Example

For our first Dendrite script, let's start the DendriteBrowser, go to google.com and enter "hello world" into the search field:

import asyncio
from dendrite_sdk import DendriteBrowser


async def hello_world():
    # You need to provide an Open AI key and an Anthropic key.
    openai_api_key = "..."
    anthropic_api_key = "..."

    # Get your Dendrite API get from Dendrite.se.
    dendrite_api_key = "..."

    # Initate the Dendrite Browser
    browser = DendriteBrowser(
        openai_api_key=openai_api_key,
        anthropic_api_key=anthropic_api_key,
        dendrite_api_key=dendrite_api_key,
    )

    # Navigate with `goto`, which returns a 'DendritePage' that controls the current page.
    page = await browser.goto("https://google.com")

    # Get elements from the current page with `get_element`.
    search_bar = await page.get_element("The search bar")
    
    # Let's enter hello world into the search bar.
    await search_bar.fill("hello world")


asyncio.run(hello_world())

See 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 DendriteBrowser with BrowserbaseBrowser 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_python_sdk import DendriteBrowser
from dendrite_sdk.ext.browserbase import BrowserbaseBrowser

... 

# browser = DendriteBrowser(...)
browser = BrowserbaseBrowser(
    # Include the previous arguments from DendriteBrowser
    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_sdk-0.1.5.tar.gz (33.3 kB view details)

Uploaded Source

Built Distribution

dendrite_sdk-0.1.5-py3-none-any.whl (52.0 kB view details)

Uploaded Python 3

File details

Details for the file dendrite_sdk-0.1.5.tar.gz.

File metadata

  • Download URL: dendrite_sdk-0.1.5.tar.gz
  • Upload date:
  • Size: 33.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for dendrite_sdk-0.1.5.tar.gz
Algorithm Hash digest
SHA256 c484c2269b33c9d4b86d784ebe593efc51bdee3f997a46e97c4f7ca93b313667
MD5 3b0f2fdde4e43cc0a0b1e9a8fee81eb3
BLAKE2b-256 1ad2b2686c718d862e8f2ca0b2395ba87cbdc510dbba9e6269f10e3f017a29c0

See more details on using hashes here.

File details

Details for the file dendrite_sdk-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: dendrite_sdk-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 52.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for dendrite_sdk-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 17e4ffd42d75b8c77f88725d9e52879cc83136f7832ee7efc844b8c1bfa4a196
MD5 0dcd96c2915eae8cf77bf7fd92df2702
BLAKE2b-256 a67f6f7cf5a5dc231ffc6fdcb5d7d3dcb95c1d39d0af75b32db6af0ec5f1a5cf

See more details on using hashes here.

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