Conversational AI over W3C-PROV provenance graphs.
yProvTalk lets you import PROV-JSON workflow traces into Memgraph and ask natural language questions through a CLI chat interface or HTTP API.
- Imports large PROV-JSON files into Memgraph using batched writes.
- Preserves W3C-PROV node types (
Entity,Activity,Agent) and relationships. - Uses Ollama as the local/self-hosted LLM backend.
- Supports interactive chat, one-shot questions, health checks, and API serving.
- Python 3.10+
- Memgraph (reachable via Bolt)
- Ollama (reachable via HTTP)
python -m venv .venv
source .venv/bin/activate
pip install -e .For development extras:
pip install -e .[dev]- Copy the example environment file:
cp .env.example .env- Edit
.envvalues as needed:
OLLAMA_HOSTOLLAMA_MODELMEMGRAPH_URIMEMGRAPH_USERMEMGRAPH_PASSWORD
The app loads .env automatically through pydantic-settings.
- Verify services are reachable:
yprovtalk health- Import a PROV-JSON file:
yprovtalk import /path/to/session.prov.json --pid run_001- Start chat:
yprovtalk chat- Ask a single question:
yprovtalk ask "Which activities used the generated model artifact?"yprovtalk chat
yprovtalk ask "<question>"
yprovtalk import <file> [--pid <source_pid>]
yprovtalk serve --host 0.0.0.0 --port 8080
yprovtalk healthWhen running:
yprovtalk serve --host 0.0.0.0 --port 8080Available endpoints:
POST /chat-> ask a question and get model responseGET /health-> checks Memgraph and Ollama connectivityGET /graph/{pid}-> returns graph nodes and links for visualization
Example:
curl -X POST http://localhost:8080/chat \
-H "Content-Type: application/json" \
-d '{"message":"Show me all agents involved in this run"}'- Import is optimized for large files with batched node/edge writes.
- Indexes are created automatically when importing.
- Duplicate import detection is based on
source_pid.
src/yprovtalk/
agent/ # ReAct loop, prompts, conversation memory
api/ # FastAPI app
importer/ # PROV-JSON -> Memgraph importer
tools/ # Graph query tools and dispatcher
settings.py # Env-driven configuration
__main__.py # Typer CLI entrypoint
GPL-3.0-or-later