Skip to content

feat: add S2P EoG sample agent and stub eog package#992

Open
UIPath-Harshit wants to merge 1 commit into
mainfrom
feat/s2p-eog-sample-agent
Open

feat: add S2P EoG sample agent and stub eog package#992
UIPath-Harshit wants to merge 1 commit into
mainfrom
feat/s2p-eog-sample-agent

Conversation

@UIPath-Harshit

Copy link
Copy Markdown
Contributor

Summary

  • Adds a sample EoG (Explanations over Graphs) agent at examples/s2p-ontology/agent/ that demonstrates graph-guided procurement investigation on the S2P ontology
  • Creates stub types at src/uipath_langchain/agent/eog/ (OntologyClient, InvestigationConfig, Belief, EoGState, create_eog_agent) so downstream code is importable before the real WU2 implementation lands
  • Includes graph.py, test_eog.py test script, langgraph.json, .env.example, and README.md

Test plan

  • Verify eog stub imports: python -c "from uipath_langchain.agent.eog import create_eog_agent, OntologyClient, InvestigationConfig, EoGState, Belief"
  • Full e2e requires live ontology-runtime (skip in CI)

🤖 Generated with Claude Code

Add a sample agent at examples/s2p-ontology/agent/ demonstrating the
EoG (Explanations over Graphs) pattern on the S2P procurement ontology.
Includes graph.py, test script, langgraph.json, and env example.

Also adds stub types at src/uipath_langchain/agent/eog/ (OntologyClient,
InvestigationConfig, Belief, EoGState, create_eog_agent) so downstream
code is importable before the real WU2 implementation lands.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 15, 2026 16:31
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
89.3% Coverage on New Code (required ≥ 90%)

See analysis details on SonarQube Cloud

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an initial “EoG (Explanations over Graphs)” surface to the library plus an S2P ontology example agent, so downstream projects can start importing/typing against the planned API while the real implementation is developed.

Changes:

  • Introduces a stub uipath_langchain.agent.eog module exporting placeholder types and create_eog_agent().
  • Adds an S2P EoG sample agent (graph, runner script, LangGraph config, env template, README) under examples/s2p-ontology/agent/.
  • Documents how to run the example locally (with external prerequisites).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/uipath_langchain/agent/eog/init.py Adds stub EoG API types and a stubbed create_eog_agent() export surface.
examples/s2p-ontology/agent/graph.py Example graph wiring for the S2P EoG agent (LLM + ontology client + graph creation).
examples/s2p-ontology/agent/test_eog.py Script-style runner to execute the compiled graph and print results.
examples/s2p-ontology/agent/README.md Example documentation and expected output description.
examples/s2p-ontology/agent/langgraph.json LangGraph CLI configuration for loading the example graph.
examples/s2p-ontology/agent/.env.example Environment-variable template for local runs.

Comment on lines +87 to +94
def create_eog_agent(
model: Any,
ontology_client: OntologyClient,
ontology_name: str,
*,
investigation_config: InvestigationConfig,
) -> StateGraph:
"""Build an EoG investigation graph (uncompiled).
Comment on lines +105 to +108
raise NotImplementedError(
"create_eog_agent is a stub. "
"Install the real eog package (WU2) to use this function."
)
Comment on lines +17 to +30
try:
from uipath_langchain.chat import UiPathChat

llm = UiPathChat(
model=os.getenv("LLM_MODEL", "gpt-4o-2024-08-06"),
temperature=0.0,
)
except Exception:
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
model=os.getenv("LLM_MODEL", "gpt-4o-2024-08-06"),
temperature=0.0,
)
Comment on lines +59 to +65
# Create EoG agent (returns uncompiled StateGraph)
eog_agent = create_eog_agent(
model=llm,
ontology_client=client,
ontology_name=os.getenv("ONTOLOGY_NAME", "s2p"),
investigation_config=investigation_config,
)
Comment on lines +31 to +37
4. **Environment variables** -- copy `.env.example` to `.env` and fill in values
(or export them directly):

```bash
cp .env.example .env
```

{
"dependencies": ["."],
"graphs": {
"agent": "./graph.py:graph"
Comment on lines +1 to +6
"""EoG (Explanations over Graphs) agent package.

Stubs for the EoG agent API. The real implementation is being built in
parallel (WU2). These placeholders let downstream code import and type-check
against the expected surface.
"""
Comment on lines +38 to +43
## Running the test script

```bash
cd examples/s2p-ontology/agent
python test_eog.py
```
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.

2 participants