Skip to content
Back to skills

Sdk Integrations

ASecurity

"Guide Wren LangChain, LangGraph, and Pydantic AI integrations

  • 247 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 9, 2026
ai-agentspythonbashsqlrailsdatabasebackend

Works with

  • cli

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill sdk-integrations --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Sdk Integrations?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Sdk Integrations
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-sdk-integrations/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-sdk-integrations)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: sdk-integrations
description: "Guide Wren LangChain, LangGraph, and Pydantic AI integrations
  through WrenToolkit, project prerequisites, tool contracts, memory controls,
  and error recovery."
disable-model-invocation: true
metadata:
  disco-role: operating
license: NOASSERTION
---

# Wren Framework SDKs

Use this sub-skill when an application agent should consume an existing,
CLI-prepared Wren project through LangChain/LangGraph or Pydantic AI.

## Shared Preconditions

1. Install the framework package and the datasource/memory extras actually used.
2. Prepare the project first:
   ```bash
   wren context validate
   wren context build
   ```
3. Ensure `wren_project.yml` and `target/mdl.json` are present before calling
   `WrenToolkit.from_project(...)`.
4. Keep connection configuration in the Wren profile plus environment-backed
   values. The toolkit reads the project and resolves profile state; it does not
   invent a database connection.

## LangChain / LangGraph

```python
from wren_langchain import WrenToolkit
from langchain.agents import create_agent

toolkit = WrenToolkit.from_project("analytics-project")
tools = toolkit.get_tools(include_memory_write=False)
agent = create_agent("openai:gpt-4o", tools=tools, system_prompt=toolkit.system_prompt(tools=tools))
```

Use `get_tools(..., raise_on_error=True)` only when the host loop should receive
exceptions instead of an LLM-readable error envelope.

## Pydantic AI

```python
from wren_pydantic import WrenToolkit
from pydantic_ai import Agent

toolkit = WrenToolkit.from_project("analytics-project")
toolset = toolkit.toolset(include_memory_write=False)
agent = Agent("openai:gpt-4o", instructions=toolkit.instructions(toolset=toolset), toolsets=[toolset])
```

Set `takes_ctx=True` only when combining Wren tools with a deps-typed Pydantic
AI toolset.

## Tool Selection Rules

- Keep `wren_dry_plan` available when an agent may generate nontrivial SQL; it
  is the cheap semantic check before `wren_query`.
- Keep `wren_list_models` available so an agent can inspect its modeled surface
  instead of hallucinating table names.
- Allow memory writes only when the host has an explicit policy for persisting
  accepted user questions and SQL; otherwise set `include_memory_write=False`.
- Do not reuse a toolkit after intentionally switching project/profile context;
  create a new instance so connection and project assumptions are explicit.

## References and Helper

- Read `references/langchain.md` for tool names, envelopes, and prompt behavior.
- Read `references/pydantic-ai.md` for typed tools and retry behavior.
- Read `references/tool-contracts.md` to keep the agent prompt synchronized
  with the tools actually supplied.
- Read `references/troubleshooting.md` for project, profile, memory, and
  framework errors.
- Run `scripts/sdk_project_probe.py --project <directory>` to check project
  prerequisites and import available framework packages without making a query.

## Guardrails

- A toolkit is one project context. Use separate toolkits for separate Wren
  projects rather than assuming profile changes hot-swap an existing toolkit.
- Memory tools are auto-detected from project state. Do not promise fetch/recall
  or memory write tools when the relevant backend/path is absent.
- LLM-facing query tools cap output. Write aggregation SQL rather than asking a
  tool for an unbounded extract.

Files in this skill

  • SKILL.md3.3 KB
  • references/langchain.md1.7 KB
  • references/pydantic-ai.md1.5 KB
  • references/tool-contracts.md1.6 KB
  • references/troubleshooting.md1.3 KB
  • scripts/sdk_project_probe.py2.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…