Skip to content

docs: complete developer documentation rewrite (#480)#601

Open
planetf1 wants to merge 78 commits intogenerative-computing:mainfrom
planetf1:update-docs
Open

docs: complete developer documentation rewrite (#480)#601
planetf1 wants to merge 78 commits intogenerative-computing:mainfrom
planetf1:update-docs

Conversation

@planetf1
Copy link
Contributor

@planetf1 planetf1 commented Mar 6, 2026

Closes #480

Complete rewrite of the Mellea developer documentation, published via Mintlify at https://docs.mellea.ai.

Preview branch: https://ibm-llm-runtime-aaf3a78b.mintlify.app/

Type of PR

  • Bug Fix
  • New Feature
  • Documentation
  • Other

What's included

Content — full Diataxis-structured developer docs

Section Pages
Getting started Installation, quickstart
Tutorials 4 end-to-end tutorials (first program → mify → generative slots → reliable agents)
Concepts Generative programming, IVR loop, requirements system, context & sessions, architecture guidance
How-to guides Structured output, custom verifiers, images & vision, async/streaming, prompt refactoring with CLI, unit testing generative code
Integrations Ollama, OpenAI, HuggingFace, vLLM, AWS Bedrock, IBM WatsonX, Google Vertex AI, MCP, LangChain, smolagents
Advanced Inference-time scaling (all 7 strategies documented), custom components, LoRA/aLoRA, intrinsics, prefix caching, security & taint tracking, template formatting, core internals
Evaluation & observability Exception handling, LLM-as-a-judge, OpenTelemetry tracing, metrics & telemetry
Examples Data extraction, legacy code migration, RAG, traced generation loop
Community Contributing guide, building extensions, code of conduct
Troubleshooting Common errors, FAQ (10 Q&A)
Reference Glossary (40+ terms, all with first-use cross-links)

All code examples verified against the current codebase. No TODO comments or "review needed" notes remain.

Standards

  • Diataxis framework throughout (tutorials / how-to / concepts / reference)
  • markdownlint passes clean (zero errors) — enforced in pre-commit and CI
  • No duplicate H1 headings (Mintlify renders frontmatter title automatically)
  • No .md extensions in internal links
  • US English, active voice, 80-char prose wrap (per docs/CONTRIBUTING.md)

CI

  • New docs-lint job in ci.yml — runs markdownlint-cli on every PR
  • markdownlint pre-commit hook — runs on staged .md files at commit time

Cleanup

  • 25 legacy .mdx files removed (overview/, core-concept/, dev/) — all content superseded by the new structure

Thanks

Thanks to @HendrikStrobelt for the original source content that anchored the concepts and advanced sections.

@mergify
Copy link

mergify bot commented Mar 6, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert|release)(?:\(.+\))?:

@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

The PR description has been updated. Please fill out the template for your PR to be reviewed.

planetf1 added 16 commits March 6, 2026 21:20
- CONTRIBUTING.md: writing conventions, PR checklist, code block
  runability rule, Backend note callout type
- .markdownlint.json: fix MD025 front_matter_title so body H1 is
  allowed alongside YAML frontmatter title
- getting-started.md: full tutorial page — install, hello world,
  user variables, requirements, core concepts, troubleshooting
- glossary.md: skeleton in place
Full how-to page covering instruct(), user variables, requirements,
custom validation functions (req/check/simple_validate), sampling
strategies + IVR loop, grounding context, images, ChatContext,
and chat() vs instruct() comparison. Imports verified against source.
One inline review note on icl_examples API pending verification.
Covers Ollama (default), OpenAI-compatible, LiteLLM, HuggingFace, and
WatsonX backends. ModelOption constants table, system prompt pattern,
direct backend construction. Backend note callouts on each provider.
Imports verified against source.
Covers @Generative decorator, Literal type constraints, Pydantic
structured output, pre/post-conditions (PreconditionException),
composing generative pipelines, and chain-of-thought pattern.
Imports verified against source.
Covers @tool decorator, MelleaTool.from_callable/from_langchain/
from_smolagents, ModelOption.TOOLS, uses_tool, tool_arg_validator,
react() agentic loop with structured output, code_interpreter.
Incorporates agent definition and ReACT context from old agents.mdx.
Imports verified against source (react is async).
Covers grounding context, RAG with FAISS + generative filtering,
@mify / MObject pattern (query/transform, ad-hoc mify, custom
stringify, funcs_include), and RichDocument with PDF parsing and
table extraction. Incorporates content from mobjects.mdx and
generative-slots.mdx. Imports verified against CI examples.
Covers all RAG intrinsic operations: answerability, context relevance,
hallucination detection, answer relevance rewriting, query rewriting,
citations, and direct Intrinsic/GraniteCommonAdapter usage.
Backend note callout on HF requirement. Imports verified against source.
Note: adapters.mdx content (tool calling) already covered in tools-and-agents.md.
Covers RejectionSamplingStrategy (with SamplingResult inspection),
validation feedback via ValidationResult.reason, SOFAISamplingStrategy
dual-model escalation with s2_solver_mode table, BudgetForcingSamplingStrategy,
and MajorityVotingStrategyForMath. Review notes on budget forcing and
majority voting exports/parameters.
Covers async/sync method table, parallel generation with ModelOutputThunk,
wait_for_all_mots, streaming with ModelOption.STREAM + astream(), and
context warnings for concurrent ChatContext use. Imports verified.
Covers three abstraction levels (instruct/act/mfuncs), working with
Message and Document, validation + sampling strategies via act(),
structured output with format=, functional API (mfuncs.act/aact),
and aact() async usage. Fixed stale numeric cross-references.
Covers GuardianCheck + GuardianRisk (full enum table), custom criteria,
groundedness detection, use as instruct() requirement, and input gate
pattern. Backend note on Guardian model independence. Verified against
CI example docs/examples/safety/guardian.py.
Covers FastMCP server creation, @mcp.tool decorator, mcp dev UI,
ModelOption in tools, multiple tools in one server. Imports verified
against mcp_example.ipynb CI notebook.
Covers two independent OTEL trace scopes (application + backend),
all configuration env vars, start_session() as context manager for
trace lifecycle, console debugging, Jaeger/OTLP export, programmatic
status checks, and metrics API (create_counter/create_histogram).
Verified against mellea/telemetry/__init__.py and telemetry_example.py.
Includes Gen-AI semantic convention attribute tables.
Covers SimpleContext vs ChatContext, ctx introspection helpers
(last_output/last_turn), session.clone() for context branching,
session.reset(), and extending MelleaSession with a ChatCheckingSession
example. Absorbs content from core-concept/context-management.mdx.
Verified against session.py and creating_a_new_type_of_session.py.
Conceptual page explaining what generative programs are, the
deterministic/stochastic interleaving challenge, requirements as the
core reliability mechanism, failure handling, uncertainty compounding,
context management, and Mellea's position as execution layer (not
orchestrator). Absorbs content from overview/generative-programming.mdx
and overview/mellea-welcome.mdx.
Covers the three core data structures (CBlock, Component,
ModelOutputThunk), six abstraction layers from MelleaSession down to
direct backend.generate_from_context() with lazy thunks, composition
via SimpleComponent, and template/prompt engineering (TemplateFormatter,
TemplateRepresentation, Jinja2 template resolution, model-specific paths).
Verified imports against session_deepdive step files. Absorbs content
from prompt-engineering.mdx.
Signed-off-by: Paul S. Schweigert <paul@paulschweigert.com>
@planetf1 planetf1 marked this pull request as ready for review March 6, 2026 21:23
@planetf1 planetf1 requested a review from a team as a code owner March 6, 2026 21:23
@planetf1
Copy link
Contributor Author

planetf1 commented Mar 6, 2026

Notes for reviewers:

  • The tutorial section needs attention. We have a few more tutorials being rewritten that we should merge in (probably easiest after PR is merged).
  • I've added a glossary (and references) to help with explanations
  • The front page has a more detailed 'guide' - but I think there are too many boxes, so needs consolidation
  • There's some documented conventions (see PR) that I am trying to ensure are followed
  • API docs are not updated yet

On Monday I plan to

  • update API docs
  • continue checking through
  • update as per above + fixes from reviews

@planetf1 planetf1 changed the title Update docs docs: complete developer documentation rewrite (#480) Mar 6, 2026
…tries

Add three new content pages:
- tutorials/02-mifying-legacy-code: five-step tutorial on @mify — query
  and transform existing Python objects with m.query() and m.transform(),
  stringify_func, fields_include, funcs_include, and ad-hoc mify(obj)
- tutorials/03-using-generative-slots: five-step tutorial on @Generative —
  Literal/Pydantic returns, pipeline composition, ChatContext injection,
  m.reset(), and pre/postcondition validation patterns
- evaluation-and-observability/evaluate-with-llm-as-a-judge: how-to
  covering default LLMaJ behavior, standalone m.validate(), GenerateLog
  capture, purple elephant effect with check(), simple_validate bypass,
  combined checks, and SamplingResult metadata

Also:
- Add all three pages to docs.json nav
- Add GenerateLog, LLM-as-a-judge, and Purple elephant effect to glossary
- Add first-use glossary cross-links and full example pointers in each page
planetf1 added 3 commits March 6, 2026 23:03
New pages:
- tutorials/04-making-agents-reliable (ReACT, requirements, GuardianCheck)
- how-to/refactor-prompts-with-cli (m decompose workflow)
- how-to/unit-test-generative-code (pytest markers, TestBasedEval)
- integrations/vertex-ai (LiteLLMBackend, vertex_ai/ model strings)
- advanced/custom-components (Component protocol, TemplateRepresentation)
- evaluation-and-observability/opentelemetry-tracing (spans, OTLP, Jaeger)
- examples/index + 4 example pages (data-extraction, legacy-code, rag, telemetry)
- community/contributing-guide, building-extensions, code-of-conduct
- troubleshooting/faq (10 Q&A)

Fixes:
- tutorials/01: broken Next steps links; model-config review note added
- docs.json: handling-exceptions moved to Eval & Observability (was How-To)
- docs.json nav: all new pages registered
- glossary: ComponentParseError, GuardianRisk, GuardianCheck expanded
- AGENTS.md: Section 10 "Writing Docs" added with key conventions
- Fix MD012 multiple-blank-lines in 20 files (trailing double blank lines)
- Fix MD028 blank-line-inside-blockquote in smolagents.md
- vertex-ai.md: replace "Hendrik please confirm" review note with
  verified LiteLLM docs — vertex_project/vertex_location keys are correct
  and override env vars at call time
- inference-time-scaling.md: remove two "review needed" notes on
  BudgetForcingSamplingStrategy and MajorityVotingStrategyForMath;
  add source-verified parameter docs for both
- inference-time-scaling.md: add sections for RepairTemplateStrategy,
  MultiTurnStrategy, and BaseSamplingStrategy (all in __all__ but
  previously undocumented)
…thonExecutionReq

- Sampling strategy table: add RepairTemplateStrategy, MultiTurnStrategy,
  MBRDRougeLStrategy, BaseSamplingStrategy, correct MajorityVoting name to
  MajorityVotingStrategyForMath
- Requirement entry: document PythonExecutionReq (code execution validator)
  with import path and key parameters
planetf1 added 2 commits March 6, 2026 23:23
…ING checklist

- Key patterns: swap MCP card for Tools and agents (@tool, MelleaTool, react())
- How-to guides: swap Handling exceptions for Use images and vision
- Backends: add LiteLLM / Vertex AI card
- CONTRIBUTING.md checklist: add item to review landing page cards when adding a major page
unit-test-generative-code.md:
- Add single top-of-page callout directing Mellea contributors to
  contributing-guide#testing; remove all other contributor callouts
- Rewrite session fixture using plain OllamaModelBackend (no gh_run)
- Rewrite module markers section as generic user guidance with pyproject.toml snippet
- Rewrite CI strategy section with a user-owned conftest.py pattern (CI=true)
  instead of Mellea's internal CICD=1 convention

traced-generation-loop.md:
- Replace dead internal reference docs/dev/telemetry.md (deleted file)
  with link to user-facing OpenTelemetry Tracing page

mellea-core-internals.md:
- mfuncs async row: "Mellea contributors" → "Advanced users building async pipelines"

template-formatting.md:
- "contributors and advanced users" → "advanced users and library authors"
- Key patterns: remove 'Generative slots' (concept already in How it works section)
  replace 'Intrinsics and adapters' (too advanced/niche) with:
  - Async and streaming (use-async-and-streaming)
  - Safety checks (GuardianCheck via tutorial 04)
- Backends: add LangChain as 8th card — makes even 4+4 grid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Restructured docs site - New organization

2 participants