NextRole ๐Ÿš€

June 28, 2026 ยท View on GitHub

NextRole

NextRole ๐Ÿš€

โœจ GenAI-Accelerated Career Advancement โœจ

Upload your CV + a job description. Get a tailored resume PDF, a researched interview-prep doc, and a day-of battlecard cheat sheet โ€” built by a multi-agent system with long-term memory.

Python Next.js React License: MIT PRs Welcome GitHub stars

LangChain LangGraph DeepAgents LangSmith Exposes MCP + A2A


NextRole start page โ€” chat-driven prep on the left, a live artifact workspace on the right

What is NextRole?

Preparing for an interview takes hours of tedious resume tailoring and company research. NextRole automates the heavy lifting. Hand it your current CV and a target Job Description (or just a JD URL) โ€” whether you're applying externally or angling for an internal move โ€” and a team of specialized AI agents researches the company, rewrites your resume to fit, coaches you round-by-round, and prints a cheat sheet for the day of.

  • ๐Ÿ“„ Tailored resume โ†’ PDF โ€” your experience rewritten against the exact JD + company research, rendered with rendercv (editable & re-renderable).
  • ๐Ÿ” Deep company & role recon โ€” live web research distilled into a match analysis.
  • ๐ŸŽฏ Structured interview prep โ€” a self-introduction plus per-round STAR stories mapped to the role.
  • โšก Day-of battlecard โ€” a one-page-per-round PDF cheat sheet for the final high-pressure review.
  • ๐Ÿ—“๏ธ Time-boxed prep plans โ€” a study plan that fits 1 month, 2 weeks, or just 3 hours.
  • ๐Ÿ”— Paste a JD URL โ€” point it at a careers page; it extracts and processes the posting for you.
  • ๐Ÿ’ฌ Iterate by chatting โ€” "add a 4th round", "add React to my skills" โ€” streaming multi-turn edits, with the right agent owning each file.
  • ๐Ÿ—‚๏ธ Built-in workspace โ€” upload, preview (PDF / MD / YAML / JSON / code), print-to-PDF, and swap the LLM at runtime.

Demo

โ–ถ๏ธ Watch the full walkthrough in HD on YouTube ยป

Quick Start

The whole stack โ€” frontend, backend, Postgres, Redis โ€” runs in Docker.

# 1. Clone & configure
git clone https://github.com/tam159/next-role.git
cd next-role
cp .env.example .env          # then fill in your API keys (see table below)

# 2. Launch everything
docker compose up -d

# 3. Find your host ports (set in .env, vary per machine)
docker ps                     # read the 0.0.0.0:<host>->... mappings

# 4. Open the app
#    Frontend UI      โ†’  http://localhost:<FRONTEND_LOCAL_PORT>/
#    Backend API docs โ†’  http://localhost:<LANGGRAPH_LOCAL_PORT>/docs

๐Ÿ’ก Pick your LLM in the app. Open the in-app Configuration dialog to set the main agent and subagent models โ€” no rebuild needed. See LLM configuration below for recommended models and free / local options.

Environment variables โ€” what to put in .env
VariableRequiredPurpose
OPENAI_API_KEYโœ…Default main + subagent models
TAVILY_API_KEYโœ…Web research (hiring-recon)
LLAMA_CLOUD_API_KEYโœ…Document parsing (LlamaParse)
POSTGRES_PASSWORDโœ…Local Postgres password
ANTHROPIC_API_KEY / GOOGLE_API_KEYโฌœAlternative providers (swap at runtime)
OPENAI_API_BASEโฌœSelf-hosted / Azure / LM Studio endpoint
AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY / AWS_DEFAULT_REGIONโฌœAWS Bedrock models
LANGCHAIN_API_KEY + LANGCHAIN_TRACING_V2=trueโฌœLangSmith tracing (recommended)
FRONTEND_LOCAL_PORT / LANGGRAPH_LOCAL_PORT / POSTGRES_LOCAL_PORT / REDIS_LOCAL_PORTpresetHost port mappings

Secrets live only in .env (gitignored); gitleaks runs on every commit.

LLM configuration โ€” pick your models, run it for free or local

Models are swappable at runtime โ€” no rebuild. Open the in-app Configuration dialog and set Main agent / Subagents to a <provider>:<model> string (e.g. anthropic:claude-sonnet-4.6); leave blank to use the defaults. Settings persist in your browser's local storage.

Recommended: Claude Sonnet 4.x, GPT-5.x, or Gemini 3.x โ€” e.g. anthropic:claude-sonnet-4.6, openai:gpt-5.4, google_genai:gemini-3.5-flash.

Run it for free or fully local:

  • Tavily and LlamaCloud both include a generous monthly free tier โ€” plenty for local use.
  • Google AI Studio offers a free tier for Gemini flash / lite models.
  • Fully local โ€” point OPENAI_API_BASE at LM Studio or Ollama (both expose an OpenAI-compatible API) and fill your local model in the UI.

Output quality tracks the model you pick โ€” smaller local models trade some quality for zero cost.

Dev workflow โ€” hot reload, restart, rebuild, stop
  • Code edits hot-reload in both containers โ€” just save the file.
  • Add a frontend dep: pnpm --dir frontend add <pkg> โ†’ docker compose restart frontend
  • Add a backend dep: uv add <pkg> โ†’ docker compose up -d --build backend
  • Change .env: docker compose restart <service>
  • Stop: docker compose down (add -v to wipe the DB & Redis volumes)

Architecture

NextRole is a supervisor agent orchestrating three specialist subagents on LangGraph + DeepAgents. The main agent handles intake, document processing, and the final battlecard; it delegates research, resume tailoring, and interview coaching to declarative subagents (defined in subagents.yaml, each with its own model, tools, and skills).

NextRole architecture

How It Works

A five-stage pipeline. Stage 4 runs the resume tailor and interview coach in parallel; Stage 6 routes follow-up edits to whichever agent owns the target file.

How NextRole works

Stage-by-stage detail
  1. Intake โ€” the agent asks for your CV, the JD (file, URL, or pasted text), your prep timeline, and any extra context.
  2. Process documents โ€” uploads are parsed to markdown via LlamaParse (parse_document); JD URLs are pulled via Tavily (extract_jd). Results land in /processed/, alongside a persisted intake note.
  3. Research โ€” the hiring-recon subagent gathers company + role intel and a match analysis โ†’ /research/<resume>/<jd>.md.
  4. Tailor & coach (parallel) โ€” resume-tailor rewrites the CV as a rendercv YAML and renders a PDF; interview-coach writes a structured prep doc (self-intro + per-round STAR stories).
  5. Battlecard โ€” the main agent assembles a one-page-per-round JSON and renders it to a day-of PDF via WeasyPrint.
  6. Multi-turn updates โ€” ask for changes in chat; the owning agent reads the existing file, preserves everything you didn't name, and re-renders.

The full procedure (file layout, update routing, source-of-truth conventions) lives in backend/app/career_agent/README.md. Per-feature design docs are in docs/prd/.

The DeepAgents stack โ€” an agent defined by filesystem primitives

The agent's behavior is configured by files, not hardcoded โ€” making it easy to read, diff, and extend:

PrimitiveWhereRoleWhen loaded
MemoryAGENTS.mdPer-stage procedure manual (semantic memory)Always (system prompt)
Skillsskills/<consumer>/<name>/SKILL.mdTask workflows (procedural memory)On demand, per consumer
Subagentssubagents.yamlSpecialist delegates โ†’ the task toolAlways
Toolstools.py + DeepAgents built-insparse_document, extract_jd, render_battlecard_pdf, prepare_render_settings, list_files, overwrite_file, plus read/write/edit_file, ls/glob/grep, executeโ€”
FilesystemCompositeBackendRoutes virtual paths to the right store (see below)โ€”
Middlewaremiddleware.pyModelOverrideMiddleware (runtime LLM swap) + UtcDatetimeMiddlewareโ€”

Subagents only receive the tools they opt into in YAML โ€” tool whitelisting keeps interview-coach, for example, from inheriting the main agent's full toolset.

Memory & storage architecture

A single CompositeBackend gives the agent one virtual filesystem while routing each path prefix to the right physical store โ€” Postgres for text artifacts, disk for binaries and render outputs, and a shell backend that translates virtual paths to real ones before running commands like rendercv render.

flowchart LR
    Agent["Agent filesystem tools<br/>read_file ยท write_file ยท edit_file<br/>ls ยท glob ยท grep ยท execute"]
    CB{{"CompositeBackend<br/>routes virtual paths"}}
    Agent --> CB
    subgraph Shell["VirtualPathShellBackend ยท default route"]
        SH["rewrites /virtual/path โ†’ on-disk path<br/>before subprocess.run<br/>(e.g. rendercv render /tailored_resume/...)"]
    end
    subgraph Store["StoreBackend ยท Postgres + pgvector"]
        ST["/memory/ ยท /processed/ ยท /research/<br/>/interview_coach/<br/>/large_tool_results/ ยท /workspace/"]
    end
    subgraph Disk["FilesystemBackend ยท disk (binaries + renders)"]
        DK["/upload/ ยท /tailored_resume/<br/>/render_intermediate/<br/>/interview_battlecard/"]
    end
    CB -->|default| Shell
    CB -->|KV routes| Store
    CB -->|binary + PDF routes| Disk
    Sem["Semantic memory ยท AGENTS.md"] -. loaded into system prompt .-> Agent
    Proc["Procedural memory ยท skills/*/SKILL.md"] -. loaded on demand .-> Agent
    Work["Working memory ยท LangGraph thread"] -. drives .-> Agent
    Store --- Epi["Episodic memory ยท persisted artifacts<br/>(incl. /memory/ auto-memory)"]
    Disk --- Epi

Mapped to memory types:

  • Working memory โ€” the live LangGraph conversation thread.
  • Semantic memory โ€” AGENTS.md, always in the system prompt.
  • Procedural memory โ€” skills/*/SKILL.md, loaded on demand.
  • Episodic memory โ€” persisted artifacts in Postgres + disk, including auto-memory: standing preferences saved to the /memory/ route and auto-applied across sessions.
Tech stack
LayerStack
BackendPython 3.13 ยท LangChain v1 ยท LangGraph 1.x ยท DeepAgents 0.6 ยท uv ยท served on langchain/langgraph-api:3.13
Agent I/OTavily (web search) ยท LlamaParse / LlamaCloud (document parsing) ยท rendercv (resume โ†’ PDF) ยท WeasyPrint (battlecard โ†’ PDF)
FrontendNext.js 16 ยท React 19 ยท TypeScript ยท Tailwind ยท pnpm ยท @langchain/react (v2 useStream)
DataPostgreSQL 18 + pgvector ยท Redis 8
InfraDocker Compose (frontend ยท backend ยท postgres ยท redis)
ObservabilityLangSmith
Expose the agent โ€” MCP & A2A

Because NextRole runs on the LangGraph Agent Server, the career_agent assistant is also reachable by other tools and agents โ€” no extra code:

  • MCP โ€” exposed as Model Context Protocol tools at /mcp (Streamable HTTP), usable by any MCP-compliant client. โ†’ docs
  • A2A โ€” Google's Agent2Agent protocol at /a2a/{assistant_id} (JSON-RPC 2.0; message/send + message/stream). โ†’ docs
  • The full server API is browsable at the /docs endpoint of your deployment.

NextRole Agent Expose

Observability โ€” LangSmith tracing

Set LANGCHAIN_API_KEY and LANGCHAIN_TRACING_V2=true in .env, and every run โ€” each LLM call, tool call, and nested subagent โ€” is traced at smith.langchain.com under the LANGCHAIN_PROJECT you configure. Optional, but invaluable for debugging the multi-agent flow.

Roadmap

  • ๐Ÿ’ค "Auto-dream" consolidation โ€” sleep-time compaction that prunes stale notes and merges insights into durable memory.
  • ๐Ÿ“ฆ Remote sandboxes โ€” swap LocalShellBackend for an isolated remote sandbox (e.g. Daytona) so render/shell steps are safe for multi-tenant use.
  • ๐Ÿ“Š Agent evaluation โ€” LangSmith evals over the workflow (the @pytest.mark.eval marker is already reserved).
  • ๐ŸŽจ Enhanced UI โ€” richer artifact editing, diff views, and inline regeneration.
  • ๐Ÿ”Œ MCP / A2A examples โ€” sample integrations driving career_agent from external agents and IDEs.
  • ๐Ÿงต Per-thread / multi-user scoping โ€” namespace artifacts per user instead of the current global layout.
  • ๐ŸŒ More sources & ATS-aware tailoring โ€” pluggable retrievers + keyword/ATS optimization passes.

Limitations

NextRole is built for local, single-user, trusted use today.

  • ๐Ÿ”’ Local shell execution โ€” VirtualPathShellBackend runs render commands via subprocess on the host. Safe locally; not hardened for multi-tenant production (needs sandboxing โ€” see roadmap).
  • ๐Ÿ‘ค Global file scoping โ€” uploads and artifacts share one filesystem layout; re-uploading a filename overwrites. No per-user isolation yet.
  • ๐Ÿงช LLM evals deferred โ€” current tests are unit + local-DB integration; automated quality evals aren't wired up yet.
  • ๐Ÿง  Personalization is preferences-only โ€” the agent persists and auto-applies the preferences you state across sessions, but doesn't yet infer your style/history on its own or consolidate memory over time (see roadmap).
  • โฑ๏ธ Latency โ€” a full run makes several LLM and tool calls across multiple agents; expect minutes, not seconds.

Contributing

PRs and issues are welcome! Start with CONTRIBUTING.md โ€” it walks through the fork โ†’ PR workflow, local setup, the CI quality gate (pre-commit + backend tests), testing, and conventions. Stack-specific details live in backend/CLAUDE.md and frontend/CLAUDE.md; commits follow Conventional Commits.

New here? Issues labelled good first issue are a gentle place to start, and questions are welcome in Discussions.

License

MIT ยฉ 2026 Tam Nguyen

Acknowledgements

Built on DeepAgents, LangChain / LangGraph / LangSmith, rendercv, WeasyPrint, Tavily, and LlamaIndex / LlamaParse.