Skip to main content
Some code has to follow rules written somewhere else: a data retention policy, a security standard, a regulator’s guidance, a contract. The rules live in documents, the code lives in a repository, and an agent changing the code usually never sees the rules. This recipe puts both in Graphify, so the agent can read the rule and the code in the same session.
Works with: Graphify (hosted) on a paid plan, with any agent connected to the hosted MCP server.

The short version

Already connected both? Paste this into your agent:

The scenario

A small team builds software for a regulated industry. Their policies sit in a shared Drive folder, and an outside reviewer asks how the code enforces one of them. Today that means someone reads the policy, then hunts through the code by hand. They want the agent to do the first pass and show its sources, so a person only has to check the answer.

What you’ll build

  • A Drive folder of policy documents, indexed in the same workspace as your code.
  • A prompt pattern that reads the rule from the documents and the matching code from the repository, with sources for both.

Before you start

Setup

1

Put the documents in one folder

Collect the policies, standards or guidance in one Google Drive folder. Supported files include Google Docs, Sheets and Slides, plus PDF, Word, Excel, PowerPoint, CSV, Markdown, text and image files.
2

Connect the folder

In Integrations, open Google Workspace · Google Drive, sign in with Google, and add the folder. Access is read-only. See Connect Google Drive.
3

Check that your agent can see it

Ask your agent to call list_repositories. The Drive folder shows up next to your code repositories, with its own name and id.

How it works

Graphify indexes the Drive folder the same way it indexes a repository, so the same search tools work on both. The agent asks two separate questions: one against the folder, one against the code. query_graph returns the matching passages with the document they came from, and graphify_rank_files ranks documents by relevance to a question. Graphify doesn’t draw links between a document and the code that implements it. The agent makes that comparison, and you check it. Treat the result as a first draft for a person to review, not as a compliance sign-off.

Make it part of changes

Add a block like this to AGENTS.md or CLAUDE.md, with your own folder and repository names:
AGENTS.md

Verify it worked

  • list_repositories shows the Drive folder as ready.
  • The agent’s answer names the policy document it quoted and cites code file paths.
  • When you open the cited document and file, they say what the agent said.

Troubleshooting

  • The folder isn’t listed. Check that Drive shows Connected in Integrations and that the folder finished syncing. Files that can’t be read are listed in the folder details.
  • Answers miss a document. Ask with words the document itself uses, or use graphify_rank_files to see which documents rank for your question.
  • The agent mixes up the folder and the code. Pass the exact name from list_repositories as repository_id in each call.

Next steps

Try it in Graphify

We build and host the graph for you. The Free plan (up to 3 repositories) needs no card. Pro and Teams start with a 14-day trial, card required.

Connectors

Connect Google Drive and other tools.

What your agent can do

Every hosted tool, with a prompt for each.