graphiti-mcp-but-working: Instructions file for Codex

AGENTS.md

graphiti-mcp-but-working AGENTS.md is an instructions file for Codex, OpenCode from michabbb/graphiti-mcp-but-working. It costs 2,082 tokens per session, scanned A, original, Apache-2.0.

Codebase instructions for a Python package that exposes Graphiti, a knowledge-graph memory service, through an MCP server. MCP is a standard way for AI tools to connect to external services.

In plain words
What is it for?
Use them when starting the server, working on its Python modules, changing configuration, or maintaining the legacy run_server.py wrapper.
Why use it?
They show how the server is organized and which entry points to use, making the package easier to run and change safely.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md.

This is michabbb/graphiti-mcp-but-working's own configuration. It tells Codex and OpenCode how to work on graphiti-mcp-but-working itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything graphiti-mcp-but-working configures →

Reuse

Borrowing it

Nothing to install: this file belongs to michabbb/graphiti-mcp-but-working. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/michabbb/graphiti-mcp-but-working/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/michabbb/graphiti-mcp-but-working

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for graphiti-mcp-but-working AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/michabbb/graphiti-mcp-but-working/agents-md/github.svg)](https://agentmods.dev/instructions/michabbb/graphiti-mcp-but-working/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/michabbb/graphiti-mcp-but-working/agents-md"><img src="https://agentmods.dev/badge/instructions/michabbb/graphiti-mcp-but-working/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for graphiti-mcp-but-working AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/michabbb/graphiti-mcp-but-working/agents-md"><img src="https://agentmods.dev/badge/instructions/michabbb/graphiti-mcp-but-working/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,082 This file is loaded in full into every session.
When invoked 2,082 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.02082 $0.02082
Opus 5.5 $0.00833 $0.00833
Sonnet 5.5 $0.00416 $0.00416
Haiku 4.5 $0.00208 $0.00208

Measured 2mo ago against content hash fea65cfc9139, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

graphiti-mcp-but-working AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 212 lines

How it starts

The opening of the file, as written. The whole thing — 212 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Graphiti MCP Server - Codebase Guide for AI Agents

This document explains the modular structure of the Graphiti MCP Server codebase to help AI agents navigate and understand the code organization.

Overview

The Graphiti MCP Server exposes Graphiti (a knowledge graph memory service for AI agents) through the Model Context Protocol (MCP). The codebase has been refactored from a single monolithic file into a well-organized Python package with focused modules.

Entry Points

There are two ways to run the server:

# As a Python package (recommended)
python -m graphiti_mcp_server [options]

# Legacy wrapper script
python run_server.py [options]

Both entry points call graphiti_mcp_server.main:main().

Important: The wrapper script is named run_server.py (not graphiti_mcp_server.py) to avoid name conflicts with the package directory.

Package Structure

graphiti_mcp_server/
├── __init__.py              # Package exports
├── __main__.py              # Entry point for `python -m graphiti_mcp_server`
├── main.py                  # CLI parsing, server startup, signal handling
│
├── config/                  # Configuration classes
│   ├── __init__.py          # Exports all config classes
│   ├── settings.py          # Global constants (DEFAULT_LLM_MODEL, SEMAPHORE_LIMIT, etc.)
│   ├── llm.py               # GraphitiLLMConfig - LLM client configuration
│   ├── embedder.py          # GraphitiEmbedderConfig - Embedding configuration
│   ├── neo4j.py             # Neo4jConfig - Database connection settings
│   ├── redis.py             # RedisConfig - Queue connection settings
│   └── graphiti.py          # GraphitiConfig, MCPConfig - Main configuration classes
│
├── models/                  # Data models and type definitions
│   ├── __init__.py          # Exports all models
│   ├── entities.py          # Pydantic models: Requirement, Preference, Procedure, ENTITY_TYPES
│   ├── responses.py         # TypedDict definitions for API responses
│   └── queue.py             # QueuedEpisode model for Redis queue
│
├── auth/                    # Authentication and authorization
│   ├── __init__.py          # Exports auth components
│   ├── nonce.py             # Nonce token validation (ALLOWED_NONCE_TOKENS, is_nonce_valid)
│   ├── principal.py         # Principal authentication (get_authenticated_principal)
│   └── middleware.py        # AuthenticationMiddleware - ASGI middleware for auth
│
├── group_id/                # Group ID management
│   ├── __init__.py          # Exports context functions
│   └── context.py           # Context variable functions for group_id allowlisting
│                            # (get_allowed_group_ids, get_effective_group_id, etc.)
│
├── queue/                   # Redis-based episode queue
│   ├── __init__.py          # Exports queue components
│   ├── state.py             # Global state variables (redis_client, queue_manager, etc.)
│   ├── manager.py           # RedisQueueManager class - queue operations
│   ├── worker.py            # process_episode_queue - background worker
│   └── init.py              # initialize_redis, shutdown_redis functions
│
├── client/                  # Graphiti client management
│   ├── __init__.py          # Exports client functions
│   └── graphiti.py          # Graphiti client initialization and singleton access
│                            # (get_graphiti_client, initialize_graphiti, etc.)
│
├── tools/                   # MCP Tool implementations (11 tools)
│   ├── __init__.py          # Exports all tools
│   ├── memory.py            # add_memory - Add episodes to the knowledge graph
│   ├── search.py            # search_memory_nodes, search_memory_facts
│   ├── episodes.py          # get_episodes, delete_episode
│   ├── edges.py             # get_entity_edge, delete_entity_edge
│   ├── groups.py            # list_group_ids, delete_everything_by_group_id
│   ├── queue_status.py      # get_queue_status - Monitor processing queues
│   └── admin.py             # clear_graph - Administrative operations
│
├── resources/               # MCP Resources
│   ├── __init__.py          # Exports resources
│   └── status.py            # get_status - Server and Neo4j connection status
│
└── utils/                   # Utility functions
    ├── __init__.py          # Exports utilities
    └── formatters.py        # format_fact_result - Format EntityEdge for output

Read the full file on GitHub · 212 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 212 lines · 2,082 tokens per session scan A fea65cfc9139

Subscribe to this mod's changes

graphiti-mcp-but-working AGENTS.md is an instructions file published in the GitHub repository michabbb/graphiti-mcp-but-working (10 stars, last pushed 5mo ago), licensed Apache-2.0. It adds 2,082 tokens to every session, about $0.0083 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

graphiti-mcp-but-working AGENTS.md compared with instructions from other repositories

graphiti-mcp-but-working AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
graphiti-mcp-but-working AGENTS.mdmichabbb/graphiti-mcp-but-workingInstructions file105mo agoApache-2.0A2,082Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
vscode ai-customization.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA1,907GitHub Copilot