The document outlines a project structure for a Python-based application using a deepagents backend and a JS/Next frontend, designed for slide generation and management. It details the organization of files and directories, the functionality of various components, and the interaction between the backend and frontend through LangGraph. Key considerations include the handling of human checkpoints, file validation, and system dependencies necessary for the application to function correctly.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0 ratings0% found this document useful (0 votes)
2 views3 pages
Source Code Structure
The document outlines a project structure for a Python-based application using a deepagents backend and a JS/Next frontend, designed for slide generation and management. It details the organization of files and directories, the functionality of various components, and the interaction between the backend and frontend through LangGraph. Key considerations include the handling of human checkpoints, file validation, and system dependencies necessary for the application to function correctly.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
Here's a project tree that maps one-to-one onto the agent roster and state contract from
before. I'm assuming a Python deepagents backend (the primary package) served
through LangGraph server, with a separate JS/Next frontend that talks to it over the
LangGraph SDK — that split gives you streaming, thread persistence, and the human-
approval interrupts essentially for free.
slidegen/
|— README. md
[_ backend/
(Le
ITTTTTTTTI
| || [=
| [=
1 | =
I | =
| docker-compose. ymt
|— .[Link]
- [Link]
| F [Link]
/ Dockerfile
[L sre/slidegen/
}_ _init_.py
[+ [Link]
[- config. py
| [Link]
| | K orchestrator
_init_.py
prompt. py
| subagents/
—init_.py
‘template_analyst.py
document_modeler. py
eae
#
#
out Line_architect.py
slide_mapper. py
content_tailor. py
asset_generator. py
slide_renderer. py
#
backend + frontend; backend image carries Li
deepagents, langgraph, langchain, fastapi,
python-pptx, markitdown[pptx], pillow, pyd
registers the deepagent graph for ~langgraph
apt: libreoffice, poppler-utils (soffice +
build_agent() -> create_deep_agent(...) ; th
model names, MAX_QA LOOPS, render DPI, capac
state extensions: run_id, workspace_path, st
phase sequencing + when to terminate the QA
each module = {name, description, prompt, to
SUBAGENTS = [template_analyst, document_mode
invoked in parallel (async subagents), one p
visual_qa_inspector.py # spawned fresh each QA pass (fresh eyes)
[Link]
[- tools/
—init_.py
schemas. py
catalog_builder. py
‘thumbnail. py
pptx_clone_edit. py
pptx_pack. py
render_slides. py
extract_text. py
assets. py
He RRS HHH
deterministic; LLMs CALL these, never emit r
pydantic: Catalog, ContentModel, Outline, Ma
SlideContent, QAReport (the filesystem co
unpack XML -> placeholder bbox / fonts / cha
9-up grid for the catalog overview
clone template slide + placeholder replace +
pack/unpack wrappers
soffice -> pdf -> pdftoppm 1-up @150dpi (per
markitdown + grep for xxxx|Lorem| ipsum
image search/gen, icons, chart builder from[LL skitts/
1 | |‘ pptxe
| backends/
L_ filesystem. py
L apis
I | HL _init_.
| [Link]
1 | L uploads. py
I |
| workspace/
L {run_idby
inputs/
catalog. json
content_model.json
out Line. json
mapping. json
py
assets/
TTTTTTTTI
ga_report. json
L_ deck. pptx
L tests/
[/ test_catalog_builder.py
| test_clone_edit. py
| L_ fixtures/
frontend/
| package. json
[LL .env. local. example
L- apps
[— layout. tsx
L_ page. tsx
| components/
| Chat. tsx
| [Link]
|_ PlanTimeLine. tsx
| Approvatate. tsx
| SlidePreview. tsx
‘_ DeckDownload. tsx
_ vbs
| [Link]
L uploads. ts
slides/slide_NN. json
renders/slide-NN. jpg
#
ea
vendored Anthropic pptx skill ([Link] + sc
deepagents FS backend rooted at workspace/{r
FastAPI: upload, kickoff run, download deck
writes template. pptx + docs -> workspace/{ru
gitignored; the agents' virtual filesysten,
template. pptx, source documents
the riskiest tool — test it hardest
next, @langchain/langgraph-sdk, react
NEXT_PUBLIC_LANGGRAPH_URL, NEXT_PUBLIC_UPLOA
useStream(): tokens + tool calls + interrupt
«pptx template + documents dropzone -> uploa
renders the write_todos plan as it updates
resumes interrupts at outline / mapping chec
shows renders/slide-NN. jpg as QA produces th
final deck. pptx
A few wiring decisions worth calling out, since they're where this kind of project usually
goes sideways:
graph. py is the whole system. It calls create_deep_agent with the orchestrator
prompt, the shared tools/ , the SUBAGENTS list, the pptx skill, and the filesystembackend. langgraph. json points at it, so langgraph dev serves it with streaming and
persistence, and the frontend's useStrean consumes it directly — no custom websocket
layer.
The run_id binds the chat thread to a workspace. When the user uploads via the FastAP!
endpoint, you mint a run_id , drop files into workspace/{run_id}/inputs/ , and root the
deepagents filesystem backend at workspace/{run_id} . Every subagent then
reads/writes plain relative paths ( catalog. json , slides/slide_03. json ) and the
orchestrator never has to carry slide content in its own context — that's the whole point of
the filesystem backend.
[Link] is the contract, not decoration. Each subagent's only job is to read its input
files and emit one validated JSON artifact. Validate on write so a malformed
mapping. json fails loudly at phase 3 instead of silently corrupting phase 5.
System deps are a real gotcha. soffice and pdftoppm are not pip-installable — they
must be in the backend Docker image. If you run agents in deepagents' sandbox backend
instead of the host, the sandbox image needs them too.
Human checkpoints ride on LangGraph interrupts. The outline and mapping gates are
interrupt() calls inthe orchestrator; [Link] catches them from the stream
and resumes with the user's edit. That's why the frontend talks to LangGraph directly
rather than a plain REST wrapper — you'd lose interrupts otherwise.
Want me to scaffold the actual files — [Link] , one representative subagent (say
slide_renderer.py ), and [Link] — so you have a runnable skeleton to build out?