Stack-aware agent
Why DuggAI answers a Next.js question differently than a Vue one — and what to feed it so the answers are right.
What "stack-aware" means
Most chat bots run a generic RAG pipeline: retrieve from your docs, answer. That works until your docs are incomplete, the user asks something framework-specific, or the question depends on what they're building with your product.
DuggAI's agent gets a stack profile alongside your docs — the frameworks, languages, libraries, and platforms your users build on. When someone asks "how do I deploy this to Vercel?", the agent answers with the Vercel-specific path, not a generic deployment overview.
What goes in the stack profile
- Frameworks your product targets (Next.js, Remix, Astro, Vue, Svelte, React Native…).
- Runtimes (Node, Bun, Deno, Cloudflare Workers, Edge runtimes).
- Languages (TypeScript, JavaScript, Python, Go).
- Build tools (Vite, Webpack, esbuild) when relevant.
- Common host platforms (Vercel, Netlify, Railway, Render, Fly).
- Adjacent SDKs your users typically combine yours with.
Where the agent uses it
Disambiguating ambiguous questions
A user asks "why is my middleware not running?" — the answer differs between Next.js Edge middleware, Express middleware, and SvelteKit hooks. Knowing the user is on Next.js (from page context, identity, or stack profile) lets the agent pick the right one.
Writing code that compiles
When the agent generates a code snippet, it uses your stack's idioms. TypeScript for TS users, async/await over callbacks, ESM where the project is ESM. Snippets that don't compile are useless — the stack profile is how we avoid them.
Knowing what to not suggest
If your product doesn't support a runtime (e.g. you don't support Cloudflare Workers yet), you can encode that in the stack profile. The agent will say so directly instead of inventing a workaround.
Setting it up
From your dashboard → Stack profile, fill in:
- Primary frameworks your product supports.
- Runtimes / hosts you officially target.
- One paragraph describing what your users typically build.
- Any "don't suggest" rules (e.g. "don't recommend webpack").
Updating it as you grow
Add new frameworks as you officially support them. Remove ones you've deprecated. The agent's answer quality is downstream of how accurate this profile stays.