plexus.documentation.test_documentation_kb_integration module
End-to-end integration test for the agent documentation knowledge base.
This test wires a real Tactus agent to the
plexus.documentation.repository.DocumentationRepository through
the same primitives that production procedures use:
plexus.cli.procedure.lua_dsl.primitives.agent.AgentPrimitive(the Tactus agent loop that invokes an LLM, executes tool calls, and appends results to its conversation),plexus.cli.procedure.model_config.ModelConfig(the same factory production agents use to build a tool-bound LangChainChatOpenAI), andthe standard
ToolPrimitive/StopPrimitive/IterationsPrimitivecompanions.
The model defaults to gpt-5.4-mini and can be overridden via
PLEXUS_DOC_KB_TEST_MODEL.
The agent is given exactly three tools - docs_list, docs_get,
and done - and a system prompt that instructs it to discover a
topic from the index, fetch its body, and then signal completion via
done. We then assert that the agent actually exercised the docs
tools (rather than hallucinating an answer) and that its final
done.reason references the canonical topic id from the loaded
markdown.
The test is marked integration and is skipped automatically when
OPENAI_API_KEY is not present, so it does not run in default CI but
can be invoked explicitly with:
pytest -m integration plexus/documentation/test_documentation_kb_integration.py
- plexus.documentation.test_documentation_kb_integration.doc_tools(repo: DocumentationRepository)
- plexus.documentation.test_documentation_kb_integration.repo() DocumentationRepository
- plexus.documentation.test_documentation_kb_integration.test_console_chat_prompt_drives_real_agent_to_use_docs(repo)
Live: the built-in Console chat prompt makes gpt-5.4-mini consult plexus.docs.
- plexus.documentation.test_documentation_kb_integration.test_tactus_agent_can_explain_how_to_set_up_a_new_score(doc_tools, repo: DocumentationRepository)
A real Tactus agent should consult the docs to walk through a how-to.
- plexus.documentation.test_documentation_kb_integration.test_tactus_agent_can_look_up_score_authoring_topic(doc_tools)
A real Tactus agent should discover the score YAML topic via docs_list.