Framework Examples
View as MarkdownDrop-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 under the hood. Pick the one that matches your stack.
- LangChain — Wrap PostGrad as a
BaseToolyour LangChain agent can call alongside other tools. Works withAgentExecutor, LangGraph, and the LCEL composition syntax. - 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 — 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 — 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 — 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:
- An API key — Create one at your dashboard. Keys are tier-scoped (Starter / Pro / Scale) and bound to your account's monthly quota.
- A feed to query — Either pass
X-PostGrad-Feed: <slug-or-uuid>to target one feed, orX-PostGrad-Feed: allto fan out across every feed you're subscribed to. Browse available feeds at the marketplace. - A search mode —
keyword(default, ts_rank),semantic(vector similarity), orhybrid(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? for the longer answer.
That's it. The framework pages above show the exact wire-up for each.