
Security News
Ruby's Bundler 4.0.18 Extends Cooldown to bundle lock and bundle cache
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.
truthstack-langchain
Advanced tools
LangChain + OpenAI function calling integration for TruthStack supplement safety API. Check interactions, get evidence, search compounds.
LangChain + OpenAI function calling integration for TruthStack supplement safety API.
Check supplement-drug interactions, get evidence balance with citations, search compounds, and access FDA adverse event signals — all through LangChain tools or OpenAI function calling.
npm install truthstack-langchain
const { getTruthStackTools } = require('truthstack-langchain');
const tools = getTruthStackTools({ apiKey: 'your-api-key' });
// tools is an array of 5 LangChain-compatible tools:
// truthstack_check_interactions
// truthstack_get_evidence
// truthstack_search_supplements
// truthstack_safety_signals
// truthstack_drug_profile
// Use with any LangChain agent:
const { AgentExecutor } = require('langchain/agents');
const agent = new AgentExecutor({ tools, llm, ... });
const result = await agent.invoke({
input: "Can I take berberine while on Ozempic?"
});
const { getOpenAIFunctions, handleOpenAIFunctionCall } = require('truthstack-langchain');
const OpenAI = require('openai');
const openai = new OpenAI();
const functions = getOpenAIFunctions();
const response = await openai.chat.completions.create({
model: 'gpt-4',
messages: [{ role: 'user', content: 'Is magnesium safe with sertraline?' }],
functions,
function_call: 'auto',
});
// Handle the function call
const call = response.choices[0].message.function_call;
const result = await handleOpenAIFunctionCall(
call.name,
JSON.parse(call.arguments),
{ apiKey: 'your-api-key' }
);
const { TruthStackClient } = require('truthstack-langchain');
const client = new TruthStackClient({ apiKey: 'your-api-key' });
// Check interactions
const safety = await client.checkInteractions(
['berberine', 'magnesium', 'vitamin_d'],
['semaglutide'] // medications
);
console.log(safety.risk_level); // "HIGH"
console.log(safety.cyp_pathway_conflicts);
console.log(safety.evidence_by_compound);
// Get evidence
const evidence = await client.getEvidence('berberine');
console.log(evidence.evidence_balance); // { positive: 8, null: 2, negative: 1, ... }
console.log(evidence.citations); // [{ pmid: "12345", claim_summary: "...", ... }]
// Search
const results = await client.searchCompounds('mag glycinate');
console.log(results.results[0].compound_id); // "magnesium"
Pre-built system prompts for common use cases:
const { SYSTEM_PROMPTS } = require('truthstack-langchain');
// Available prompts:
SYSTEM_PROMPTS.supplement_safety_advisor // General supplement safety
SYSTEM_PROMPTS.glp1_supplement_checker // GLP-1/Ozempic focus
SYSTEM_PROMPTS.evidence_researcher // Research evidence analysis
SYSTEM_PROMPTS.stack_optimizer // Stack optimization
SYSTEM_PROMPTS.clinician_assistant // Clinician-facing
| Tool | Description |
|---|---|
truthstack_check_interactions | Check supplement-supplement and supplement-drug interactions |
truthstack_get_evidence | Get evidence balance + citations for a compound |
truthstack_search_supplements | Fuzzy search for supplements |
truthstack_safety_signals | FDA adverse event (CAERS/FAERS) data |
truthstack_drug_profile | Drug CYP450 pathways + botanical interactions |
TRUTHSTACK_API_KEY=your-key # Required
TRUTHSTACK_BASE_URL=https://api.truthstack.co # Optional
Get a free API key (2,000 calls/month) at truthstack.co/developers.
TruthStack's vault contains:
MIT
FAQs
LangChain + OpenAI function calling integration for TruthStack supplement safety API. Check interactions, get evidence, search compounds.
The npm package truthstack-langchain receives a total of 2 weekly downloads. As such, truthstack-langchain popularity was classified as not popular.
We found that truthstack-langchain demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.

Company News
Socket is now in the AWS Security Hub Extended plan. Adopt it through AWS, apply committed spend, and block malicious open source packages.