---
title: Framework Examples
description: Drop-in patterns for using PostGrad with LangChain, CrewAI, and n8n.
---

If your agent runs inside a popular framework, the examples below show the smallest amount of code needed to wire PostGrad in as a knowledge source. All three approaches call the same [REST API](/docs/api) under the hood. Pick the one that matches your stack.

- **[LangChain](/docs/integrations/langchain)** — Wrap PostGrad as a `BaseTool` your LangChain agent can call alongside other tools. Works with `AgentExecutor`, LangGraph, and the LCEL composition syntax.
- **[CrewAI](/docs/integrations/crewai)** — Expose PostGrad as a CrewAI tool that any agent in your crew can use. Pairs naturally with role-based crews that need domain expertise.
- **[n8n](/docs/integrations/n8n)** — Configure an HTTP Request node to query PostGrad inside n8n workflows. Useful for low-code automations and AI Agent nodes that want a knowledge fallback before answering.

## Not using one of these frameworks?

You have two simpler paths:

- **[MCP](/docs/mcp-integration)** — If your agent runs in Claude Desktop, Cursor, Windsurf, ChatGPT, or any MCP-compatible client, the PostGrad MCP server gives you tools, resources, and prompts with no code. Two-minute setup.
- **[SDKs](/docs/sdks)** — Official TypeScript and Python clients that wrap the REST API with typed interfaces, automatic retries, and a default-feed option.

## What every integration needs

Regardless of framework, you'll need:

1. **An API key** — Create one at [your dashboard](https://postgrad.io/dashboard/keys). Keys are tier-scoped (Starter / Pro / Scale) and bound to your account's monthly quota.
2. **A feed to query** — Either pass `X-PostGrad-Feed: <slug-or-uuid>` to target one feed, or `X-PostGrad-Feed: all` to fan out across every feed you're subscribed to. Browse available feeds at [the marketplace](https://postgrad.io/marketplace).
3. **A search mode** — `keyword` (default, ts_rank), `semantic` (vector similarity), or `hybrid` (RRF fusion). All three modes are available on every tier. For natural-language agent queries, semantic is usually the right default. See [Which mode should I pick?](/docs/api#which-mode-should-i-pick) for the longer answer.

That's it. The framework pages above show the exact wire-up for each.
