# RAG Project Query

> Query the project-level LightRAG knowledge graph for project-specific context and decisions

- Skill: `butchokoy25/rag-project-query` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add butchokoy25/rag-project-query`
- Raw SKILL.md: https://api.skillmd.com/api/skills/butchokoy25/rag-project-query/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: butchokoy25 (https://skillmd.com/u/butchokoy25)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/butchokoy25/rag-project-query

---


# RAG Project Query — Project Knowledge Graph

Query the project-level LightRAG knowledge graph for architecture decisions, conventions, dependencies, and project-specific context.

## Query Modes

| Mode | When to use | What it does |
|------|------------|--------------|
| `hybrid` (default) | Most queries | Combines local entity relationships + global topic summaries |
| `local` | "What's related to X in this project?" | Traverses entity relationships from specific nodes |
| `global` | "What are the project conventions?" | Summarizes across all project documents |
| `naive` | Simple keyword lookup | Basic text search, fastest but least intelligent |

## How to query

### Full query

```bash
node -e "
const BASE = 'http://YOUR_LIGHTRAG_HOST:YOUR_PROJECT_PORT';
const API_KEY = process.env.LIGHTRAG_API_KEY || 'YOUR_API_KEY';
(async () => {
  const res = await fetch(BASE + '/query', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-API-Key': API_KEY
    },
    body: JSON.stringify({
      query: 'QUERY_HERE',
      mode: 'hybrid'
    })
  });
  const data = await res.json();
  console.log(JSON.stringify(data, null, 2));
})();
"
```

### Context-only query

```bash
node -e "
const BASE = 'http://YOUR_LIGHTRAG_HOST:YOUR_PROJECT_PORT';
const API_KEY = process.env.LIGHTRAG_API_KEY || 'YOUR_API_KEY';
(async () => {
  const res = await fetch(BASE + '/query', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-API-Key': API_KEY
    },
    body: JSON.stringify({
      query: 'QUERY_HERE',
      mode: 'hybrid',
      only_need_context: true
    })
  });
  const data = await res.json();
  console.log(typeof data === 'string' ? data : JSON.stringify(data, null, 2));
})();
"
```

## Response format

When presenting results:
- Distinguish project memory from personal memory — prefix with "Project context:" when relevant
- Be concise — summarize, don't dump raw JSON
- Cite the source type (e.g., "from an architecture decision stored on 2026-03-20")
- Flag stale info (>30 days old)
- If no results, say so — don't fabricate

## Infrastructure

- **Server**: `YOUR_LIGHTRAG_HOST:YOUR_PROJECT_PORT`
- **Auth**: X-API-Key header (auth-enabled mode)
- **Env var**: `LIGHTRAG_API_KEY`
- **Workspace**: Project-specific (separate from personal graph)

