First Steps in AI Solutions Engineering¶
| Category | AI Solutions Engineering |
| Status | ✅ Completed |
| Repo | nextwork-first-steps-in-ai-solutions-engineering |
| Original NextWork guide | nextwork.ai |
| Proof | Official NextWork write-up: web · PDF |
Learning project
Practice work following a NextWork guide, separate from my production projects.
📚 NextWork learning project. This is a practice project I built while working through NextWork's First Steps in AI Solutions Engineering guide. It is part of my Learning portfolio and is fully separate from my production projects.
Category: Learning › AI Solutions Engineering
Status: ✅ Completed
Proof: Official NextWork write-up: web · PDF
Overview¶
Design first, then code that provably matches the design. docs/architecture.md holds the C4 context and container diagrams plus a table mapping each container to one Python module and its allowed dependencies. tests/test_architecture.py parses that table and the code's imports, so CI fails if, for example, the API starts calling the provider directly.
Summary¶
The C4 diagram (Mermaid), the FastAPI /ask path through the orchestrator to the provider, the architecture contract test, GitHub Actions CI, and the secret-mission /ask-architecture endpoint are all built, and the verification answers through a real model (local Ollama standing in for Gemini).
The checks behind this are in docs/verification.txt.
Skills & tools¶
C4 model, Mermaid, FastAPI, Architecture testing, GitHub Actions, LLM provider abstraction
What I built¶
docs/architecture.md: C4 context and container diagrams plus the container → module contract table.app/api.py,app/orchestrator.py,app/providers.py: one module per container.tests/test_architecture.py: the contract (every container has a module, every module is in the diagram, and imports follow the arrows)..github/workflows/ci.yml: runs everything on each push, with no secrets needed.POST /ask-architecture: answers questions about the system, grounded in the diagram (secret mission).
How to run¶
pip install -r requirements.txt
uvicorn app.api:app --reload
curl -s localhost:8000/ask -H 'content-type: application/json' -d '{"question":"What is a C4 diagram?"}'
PROVIDER=ollama uvicorn app.api:app # real local model
pytest -q
Verification¶
I ran the verification command on 2026-12-02. The full output is in docs/verification.txt.
/workspace/nextwork-portfolio/.venv/bin/python -m pytest -q -p no:cacheprovider tests && PROVIDER=ollama /workspace/nextwork-portfolio/.venv/bin/python -c "from fastapi.testclient import TestClient; from app.api import app; print(TestClient(app).post('/ask', json={'question':'In one sentence, what is a C4 container diagram?'}).json())"
Notes¶
Honest observation: when I asked the local qwen2.5:1.5b model through /ask what a C4 container diagram is, it gave a different inaccurate definition on each run (e.g. calling it a kind of UML diagram, or a "four-layer" view). docs/verification.txt holds the latest answer. That's why /ask-architecture grounds answers in the diagram file rather than trusting model knowledge. CI runs on GitHub Actions for every push to this repo. Check the Actions tab for the latest result.
Model/provider substitution: the guide's provider is Gemini, which needs an API key I didn't create. The provider adapter keeps a Gemini implementation, and the verification runs the same path against a local open model through Ollama (PROVIDER=ollama), with a deterministic fake provider for CI.
Original project: https://nextwork.ai/projects/354625dc-f56c-4fd5-a225-b577c8b19422 · Part of my NextWork Learning portfolio (hub).
Verification output¶
From docs/verification.txt:
$ /workspace/nextwork-portfolio/.venv/bin/python -m pytest -q -p no:cacheprovider tests && PROVIDER=ollama /workspace/nextwork-portfolio/.venv/bin/python -c "from fastapi.testclient import TestClient; from app.api import app; print(TestClient(app).post('/ask', json={'question':'In one sentence, what is a C4 container diagram?'}).json())"
...... [100%]
6 passed in 0.45s
{'answer': "A C4 container diagram is a simplified visual representation of a container's components, showing dependencies and relationships between them.", 'provider': 'ollama'}
[exit code 0]