-
Notifications
You must be signed in to change notification settings - Fork 0
Learning Rest Openapi Agent Workflow
Intermediate to expert.
Full-stack developers, AI-agent engineers, platform teams, and instructors teaching tool-calling workflows.
By the end, you can:
- start the CaeReflex REST server in a bounded workspace;
- inspect health and OpenAPI endpoints;
- import a case through the API;
- retrieve agent context and inspection flags; and
- design safe tool instructions for Custom GPT, Claude-style, or internal agents.
- Architecture: REST API
- Reference: OpenAPI
openapi/openapi.yamlexamples/agent_workflow/
Start the server from the repository root:
caereflex serve --host 127.0.0.1 --port 8765 --workspace .In another terminal:
curl http://127.0.0.1:8765/health
curl http://127.0.0.1:8765/openapi.yaml
curl -X POST "http://127.0.0.1:8765/cases/import" \
-H "Content-Type: application/json" \
-d '{"path":"examples/openfoam_cavity_minimal","adapter":"auto","attach_crossref":false,"return_agent_context":true}'Use the returned case_id:
curl "http://127.0.0.1:8765/cases/CASE_ID/agent-context"
curl "http://127.0.0.1:8765/cases/CASE_ID/inspection-flags"- The OpenAPI schema describes the tool surface for action-capable agents.
- Case paths should be workspace-relative.
- CrossRef should be requested explicitly, not silently.
- Agent answers must preserve inspection warnings and safe-use policy.
A representative health response is intentionally small:
{"status": "ok", "service": "caereflex"}A representative import response for examples/openfoam_cavity_minimal should include the stored case identifier and optional agent context:
{
"status": "success",
"case_id": "case_6c5707a83ec1",
"summary": "OpenFOAM case inspected. 8 files were considered.",
"warnings": [],
"provenance_summary": ["openfoam_inspection_started"],
"next_recommended_actions": ["get_agent_context", "export_case_report"],
"data": {
"agent_context": {
"case_type": "openfoam",
"source_files": [{"relative_path": "system/controlDict", "hash_status": "complete"}],
"do_not_claim": ["Do not claim simulation convergence unless explicit evidence is present."]
}
}
}A representative inspection-flags response is:
{"inspection_flags": []}Interpret the output as follows:
- Extracted evidence:
source_files,detected_formats, field records, and hashes indata.agent_contextcome from the workspace-relative example path. - Inferred context:
summary,next_recommended_actions, and case classification help sequence agent behavior; they are not engineering conclusions. - Warnings: top-level
warningsand/inspection-flagsmust be fetched and echoed before summarization. An empty list is only an absence of emitted flags for that run. - Provenance:
provenance_summaryidentifies adapter events that produced the stored case. - Unsafe claims to avoid: agents must not claim validation, convergence, mesh adequacy, certification, design safety, unrestricted filesystem access, or CrossRef attachment unless the corresponding endpoint was explicitly called.
Identify the health endpoint, OpenAPI endpoint, import endpoint, and agent-context endpoint.
Draft safe agent instructions that require health check, case import, agent context retrieval, and inspection flag review before summarization.
Review API exposure risks:
- What changes when binding outside localhost?
- Why is an API key required for external exposure?
- How should workspace boundaries shape agent tool descriptions?
- What should an agent do if a user provides an absolute path?
- The learner understands the REST workflow sequence.
- The learner can write a safe agent prompt or tool policy.
- The learner explains workspace and authentication risks.
- Home
- Architecture
- Developer-Guide
- Learning
- Reference
- Releases
- User-Guide
Synced from /wiki/docs in the main CaeReflex repository.