# Phase 4 — Resources & Prompts

> Rich schema resources and multi-step workflow orchestrator prompts.

## Status: In Progress

## Research-Informed Changes

- `graph://schema` now samples nodes to show property keys with example values
- `graph://schema` discovers edge type source->target label patterns via queries
- `graph://nodes/{node_id}` includes a connection summary (edge types + counts)
- Prompts are now **workflow orchestrators** guiding agents through multi-step tool sequences
- Added `graph_analysis` prompt (communities + PageRank + hub exploration)
- Added `similarity_search` prompt (vector search + graph context)
- All prompts reference actual tool names so agents know exactly what to call

## Resources

| URI                       | Description                                        |
| ------------------------- | -------------------------------------------------- |
| `graph://schema`          | Rich schema: labels with properties, edge patterns |
| `graph://stats`           | Performance stats: counts, memory, config          |
| `graph://nodes/{node_id}` | Node details + connection summary                  |

## Prompts

| Prompt                 | Workflow                                                        |
| ---------------------- | --------------------------------------------------------------- |
| `explore_graph`        | graph_info -> sample labels -> get_neighbors -> pattern queries |
| `knowledge_extraction` | analyze text -> create_node -> create_edge -> verify            |
| `graph_analysis`       | graph_info -> louvain -> pagerank -> get_neighbors -> report    |
| `similarity_search`    | find index -> get vector -> vector_search -> get_neighbors      |

## Tasks

- [x] Implement `graph://schema` with label sampling and edge pattern discovery
- [x] Implement `graph://stats` with counts, memory, and config info
- [x] Implement `graph://nodes/{node_id}` with connection summary
- [x] Implement `explore_graph` as multi-step workflow guide
- [x] Implement `knowledge_extraction` as entity extraction workflow
- [x] Implement `graph_analysis` as analytical exploration workflow
- [x] Implement `similarity_search` as vector search workflow
- [ ] Write `tests/test_resources.py`
- [ ] Write `tests/test_prompts.py`
- [ ] Test resource URIs with `mcp dev` or Claude Desktop

## Design Decisions

### Resources return structured text (not JSON)

Schema and stats resources return human-readable structured text with clear headers
and indentation. This is more token-efficient for AI agents than raw JSON dumps.

### Prompts are workflow orchestrators

Each prompt returns a step-by-step guide that references specific tool names with
example invocations. This teaches agents the intended tool sequence rather than
leaving them to discover it through trial-and-error.
