Skip to content

Instantly share code, notes, and snippets.

from langchain.chat_models import ChatOpenAI
from langchain.prompts import ChatPromptTemplate
from langchain.schema.output_parser import StrOutputParser
import requests
from bs4 import BeautifulSoup
from langchain.schema.runnable import RunnablePassthrough, RunnableLambda
from langchain.utilities import DuckDuckGoSearchAPIWrapper
import json
RESULTS_PER_QUESTION = 3
@donbr
donbr / rag_from_scratch_playlist.json
Created April 2, 2024 19:37
rag_from_scratch_playlist
{
"kind": "youtube#playlistItemListResponse",
"etag": "4oVDxXOqlyaVnRrnJXuhwXPhMSg",
"items": [
{
"kind": "youtube#playlistItem",
"etag": "bh6WIsa4tB6e6DgavMaPsvdBOOA",
"id": "UExmYUlERkVYdWFlMkxYYk8xX1BLeVZKaVEyM1p6dEEweC41NkI0NEY2RDEwNTU3Q0M2",
"snippet": {
"publishedAt": "2024-02-06T01:10:40Z",
@donbr
donbr / langchain_rag_from_scratch.md
Last active March 27, 2025 06:01
RAG from Scratch
@donbr
donbr / README.md
Created April 18, 2024 16:13 — forked from disler/README.md
Use these Prompt Chains to build HIGH QUALITY AI Agents (Agentic Building Blocks)

Setup

  1. Create a new directory with these three files (requirements.txt, main.py, README.md)
  2. python -m venv venv
  3. source venv/bin/activate
  4. pip install -r requirements.txt
  5. python main.py
  6. Update main() to run the example prompt chains
@donbr
donbr / yt-email-reply-llama3-crewai-groq.ipynb
Last active April 22, 2024 17:19
yt-email-reply-llama3-crewai-groq.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@donbr
donbr / einar_and_the_bear_draft.md
Last active May 19, 2024 09:36
Einar and the Bear - Draft

Einar and the Bear - Draft

Prologue: The Pact of Shadows and Light

Before the village of Einar lay under the watchful protection of the Spirit Bear, before the forest whispered secrets through the snow, and before Einar became known as the Bear Slayer, there was a pact—a covenant between the ancient spirits of the forest and the first settlers of the land. This pact was born from necessity, a mutual understanding that for both to thrive, a balance must be maintained.

In the time when the world was younger, when the trees stretched so high they seemed to touch the sky, and the spirits roamed freely among the living, the first villagers sought to make their home at the forest's edge. They understood the sanctity of the land, the sacredness of the woods that teemed with life and ancient magic. In their wisdom, they knew that to live in harmony with such a force, a pact must be made.

The elders of the village, guided by dreams sent by the forest spirits, ventured deep into the heart of the woods, to a c

@donbr
donbr / cypher_query_optimization.md
Last active August 29, 2024 16:07
Cypher Query Optimization - schema considerations

Cypher Query Optimization

  • Neo4j graph database is based on Guide to Pharmacology ontology
  • Ontology imported using n10s

Samply Query

WITH ["ns0__EnzymeTargetFamily", 
      "ns0__OtherProteinTargetFamily", 
@donbr
donbr / genetic_testing_omics_table.md
Last active September 12, 2024 18:57
genetic_testing_omics_table

Genetic Testing and Omics Approaches in Clinical Trials: An Overview for Non-Specialists

In the context of clinical trials, genetic testing and omics approaches play a crucial role in understanding disease mechanisms, drug responses, and individual variations. These methodologies provide researchers with valuable insights that can lead to more targeted and effective treatments. Here's an overview of the key techniques and their applications:

Genetic testing and Omics approaches

A concise overview of the various genetic testing methods and omics approaches used in clinical trial prescreening. It highlights the key features, use cases, and examples for each approach, making it easier to compare and understand their applications in clinical research.

Test/Approach Description Use Case Example
@donbr
donbr / string-db-protein-api-queries.md
Created September 14, 2024 08:32
Leveraging STRING Database API Queries to Elucidate Sensitivity and Resistance Mechanisms in Cancer Cells

Leveraging STRING Database API Queries to Elucidate Sensitivity and Resistance Mechanisms in Cancer Cells

Abstract

Understanding the molecular mechanisms underlying cancer cell sensitivity and resistance to targeted therapies is crucial for the development of effective treatments. Protein-protein interaction (PPI) networks provide valuable insights into these mechanisms. This study demonstrates the use of optimized STRING database API queries to investigate key proteins and pathways associated with sensitivity and resistance in cancer cells harboring specific genetic mutations. Five focused queries were designed to explore interactions involving Aurora kinases, CDK4/6, KIF11, the MDM2-TP53 axis, and the RAS-MEK-ERK signaling pathway. The results highlight critical interactions and pathways that may contribute to drug response, emphasizing the significance of integrating PPI data to uncover potential therapeutic targets and enhance our understanding of cancer biology.

Introduction

Cancer remains a

@donbr
donbr / revolutionizing-drug-repurposing-and-discovery.md
Created September 15, 2024 22:32
Revolutionizing Drug Repurposing and Discovery: Harnessing Pharmacological Datasets with Cloud Graph Databases

Revolutionizing Drug Repurposing and Discovery: Harnessing Pharmacological Datasets with Cloud Graph Databases

In the ever-evolving landscape of drug discovery and development, the ability to efficiently analyze vast amounts of pharmacological and bioinformatics data has become paramount. This article explores how the integration of comprehensive datasets like PubChem and the Guide to Pharmacology with cloud-based graph databases such as Neo4j's AuraDB is transforming drug repurposing and discovery efforts.

We'll delve into practical examples, showcasing how graph databases are uniquely suited to visualizing and interpreting the complex, multidimensional data typical in pharmacology. Our recent analysis of the STE7 kinase family serves as a compelling case study, demonstrating the power of this approach in uncovering new insights and potential therapeutic strategies.

Join us as we explore how these cutting-edge tools and methodologies are paving the way for more efficient, data-driven drug discovery and