import pathlib HTML = '''\ DocMind — AI Document Research
🔗 LangGraph ⛩ LangChain LCEL 🗃 FAISS+BM25+RRF
No source loaded
📚
Knowledge Base
📄
Click to browse or drag & drop
PDF only · max 10 MB
📄
✓ Ready for questions
🛠
Powered By
🔗
LangGraph 0.2
StateGraph · 5 nodes
LangChain LCEL
prompt | llm | parser
🗃
FAISS + BM25
RRF hybrid retrieval
🪘
HF Embeddings
bge-small-en-v1.5
🆕
Flask 3.1
+ Gunicorn WSGI
🐺
Docker
HuggingFace Spaces
📊
Live Pipeline
LLM Agent Local Score & I/O
💾 Ingestion
📄
Source
PDF · URL
PyPDF / BeautifulSoup
Chunker
RecursiveTextSplitter
1500 ch · 200 overlap
🗃
Hybrid Index
FAISS + BM25
768-dim · RRF k=60
↑ feeds Retriever
LangGraph StateGraph — research pipeline
🤖 Research Agents
🎯
Planner
LLM · temp 0.3
Research plan · 200 tok
🔍
Retriever
FAISS + BM25
top-k 5 · RRF fusion
Grader
Score · ~1 ms
0.7×vec + 0.3×kw
Generator
LLM · temp 0.4
Cited answer · 512 tok
🔬
Critic
LLM · temp 0.1
APPROVED / NEEDS‑REVIEW
📋
Answer
Cited · Verified
inline [Source, p.N]
🔍
Research Query
Your Question
📰 Agent Trace
🧠 Answer
''' out = pathlib.Path(__file__).parent / "templates" / "index.html" out.write_text(HTML, encoding="utf-8") print(f"Done, size: {len(HTML)}")