A2A agent protocol interoperability, Agent Cards, and MCP bridging / Protokol agen A2A, Agent Cards, dan integrasi MCP.
日本語の概要は準備中です。原文の説明を表示しています。
Expert guide for Knowledge Graphs, GraphRAG, Microsoft GraphRAG, Neo4j Text2Cypher, multi-hop relational retrieval, and hybrid vector-graph search / Panduan ahli Knowledge Graph, GraphRAG, dan pencarian relasional multi-hop.
日本語の概要は準備中です。原文の説明を表示しています。
実行スコア 未検証
インストール方法を見るインストールする前に、エージェントに与えられる指示の中身を確認できます。
<a name="english"></a>
vector-db-rag-expert, search-engine-expert, xerj-search-expertdatabase-orm-expert, living-codebase-ast-graphai-llm-integration-expert, frontier-ai-models-expert, context-window-engineerai-safety-governance-expert, prompt-injection-firewall, anti-slopzero-to-prod-orchestrator, session-memory-managerExpert guide for implementing Knowledge Graph-augmented Retrieval (GraphRAG), solving the fatal weaknesses of vector search: multi-hop reasoning, relationship discovery, and global corpus understanding. Covers Microsoft GraphRAG, Neo4j Text2Cypher, FalkorDB, and hybrid Vector + Graph retrieval pipelines.
| Capability | Pure Vector Search (RAG) | GraphRAG (Graph + Vector) |
|---|---|---|
| Direct Similarity ("What is X?") | 🟢 Fast, accurate | 🟢 High accuracy |
| Multi-Hop Traversal ("How does X affect Z via Y?") | 🔴 Blind (returns fragmented chunks) | 🟢 Explores interconnected graph edges |
| Global Corpus Query ("What are the main themes across all documents?") | 🔴 Fails (limited to Top-K chunks) | 🟢 Hierarchical Community Summaries |
| Hallucination Rate on Complex Queries | 🔴 Moderate to High (context stitching) | 🟢 Grounded in explicit knowledge edges |
Using Neo4j with deterministic schema introspection, preventing arbitrary syntax hallucinations.
// text2cypher.ts - Safe Neo4j Query Generation & Execution
import neo4j, { Driver } from 'neo4j-driver';
import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
export class GraphRAGService {
private driver: Driver;
constructor(uri: string, user: string, pass: string) {
this.driver = neo4j.driver(uri, neo4j.auth.basic(user, pass));
}
// 1. Fetch live Graph Schema to ground the LLM
private async getGraphSchema(): Promise<string> {
const session = this.driver.session();
try {
const result = await session.run(`
CALL apoc.meta.schema() YIELD value
RETURN value
`);
return JSON.stringify(result.records[0]?.get('value') || {});
} finally {
await session.close();
}
}
// 2. Synthesize strict read-only Cypher query
public async queryGraph(userQuestion: string): Promise<any[]> {
const schema = await this.getGraphSchema();
const { text: cypherQuery } = await generateText({
model: openai('gpt-4o-mini'),
system: `
You are an expert Neo4j Cypher generator.
Generate ONLY valid, read-only CYPHER queries based on this schema:
${schema}
Rules:
- Never generate CREATE, MERGE, DELETE, or SET statements.
- Always use parameterization where appropriate.
- Output ONLY the raw Cypher query, without markdown or backticks.
`,
prompt: `Translate this question into Cypher: ${userQuestion}`,
});
const sanitizedCypher = cypherQuery.trim().replace(/^```cypher|```$/g, '');
// 3. Execute with read-only transaction
const session = this.driver.session({ defaultAccessMode: neo4j.session.READ });
try {
const res = await session.run(sanitizedCypher);
return res.records.map((r) => r.toObject());
} finally {
await session.close();
}
}
public async close(): Promise<void> {
await this.driver.close();
}
}
# graph_extractor.py - Structured Entity & Relation Extraction
from typing import List
from pydantic import BaseModel, Field
import instructor
from openai import OpenAI
client = instructor.from_openai(OpenAI())
class Entity(BaseModel):
name: str = Field(description="Normalized entity name, uppercase")
type: str = Field(description="ORGANIZATION, PERSON, TECHNOLOGY, CONCEPT, LOCATION")
description: str = Field(description="Summary of entity role")
class Relationship(BaseModel):
source_entity: str
target_entity: str
relation_type: str = Field(description="USES, DEVELOPS, OWNS, LOCATED_IN, DEPENDS_ON")
weight: float = Field(default=1.0, ge=0.0, le=1.0)
description: str
class KnowledgeGraph(BaseModel):
entities: List[Entity]
relationships: List[Relationship]
def extract_knowledge_graph(document_text: str) -> KnowledgeGraph:
"""Extracts entities and relationships from raw text into structured schema."""
return client.chat.completions.create(
model="gpt-4o-mini",
response_model=KnowledgeGraph,
messages=[
{
"role": "system",
"content": (
"Extract all named entities and factual relationships between them. "
"Ensure entity names are canonicalized and relationships are directed."
),
},
{"role": "user", "content": document_text},
],
temperature=0.0,
)
For high-level summaries ("Summarize all technical debts reported across the system"):
<a name="bahasa-indonesia"></a>
vector-db-rag-expert, search-engine-expert, xerj-search-expertdatabase-orm-expert, living-codebase-ast-graphai-llm-integration-expert, frontier-ai-models-expert, context-window-engineerai-safety-governance-expert, prompt-injection-firewall, anti-slopzero-to-prod-orchestrator, session-memory-managerPanduan ahli untuk mengimplementasikan Knowledge Graph-augmented Retrieval (GraphRAG), memecahkan kelemahan fatal pencarian vektor konvensional: penalaran multi-langkah (multi-hop reasoning), penemuan relasi antar-entitas, dan pemahaman korpus global. Mencakup Microsoft GraphRAG, Neo4j Text2Cypher, FalkorDB, dan pipeline hybrid Vector + Graph.
import neo4j, { Driver } from 'neo4j-driver';
import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
export class LayananGraphRAG {
private driver: Driver;
constructor(uri: string, user: string, pass: string) {
this.driver = neo4j.driver(uri, neo4j.auth.basic(user, pass));
}
// Ambil skema graf langsung untuk grounding LLM
private async ambilSkemaGraf(): Promise<string> {
const session = this.driver.session();
try {
const hasil = await session.run('CALL apoc.meta.schema() YIELD value RETURN value');
return JSON.stringify(hasil.records[0]?.get('value') || {});
} finally {
await session.close();
}
}
// Sintesis query Cypher read-only yang aman
public async tanyaGraf(pertanyaanPengguna: string): Promise<any[]> {
const skema = await this.ambilSkemaGraf();
const { text: queryCypher } = await generateText({
model: openai('gpt-4o-mini'),
system: `Anda adalah ahli pembuat query Neo4j Cypher. Buat HANYA query Cypher read-only berdasarkan skema:\n${skema}\nAturan: Dilarang membuat perintah mutasi CREATE/DELETE.`,
prompt: `Terjemahkan pertanyaan berikut ke Cypher: ${pertanyaanPengguna}`,
});
const cypherBersih = queryCypher.trim().replace(/^\`\`\`cypher|\`\`\`$/g, '');
const session = this.driver.session({ defaultAccessMode: neo4j.session.READ });
try {
const hasil = await session.run(cypherBersih);
return hasil.records.map((r) => r.toObject());
} finally {
await session.close();
}
}
}
まだレビューはありません。使ってみた感想をお寄せください。
ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。
まだコメントはありません。最初のコメントを書いてみませんか。
A2A agent protocol interoperability, Agent Cards, and MCP bridging / Protokol agen A2A, Agent Cards, dan integrasi MCP.
日本語の概要は準備中です。原文の説明を表示しています。
Expert guide for automated and manual Web Accessibility (a11y) testing — axe-core, Pa11y, Playwright a11y, screen reader testing, and WCAG 2.2 Level AA/AAA compliance / Panduan ahli pengujian aksesibilitas web.
日本語の概要は準備中です。原文の説明を表示しています。
Web accessibility testing with axe-core, Playwright, and WCAG 2.2 / Pengujian aksesibilitas web axe-core, Playwright, dan WCAG 2.2.
日本語の概要は準備中です。原文の説明を表示しています。
Model cascading & complexity-scored routing (Grok, Gemini, Claude) / Routing kaskade model & scoring kompleksitas (Grok, Gemini, Claude).
日本語の概要は準備中です。原文の説明を表示しています。
Expert guide for intelligent model cascading and routing — complexity-scored task routing from Flash/Haiku to Sonnet/Opus/Astra, dynamic escalation with quality gates, 40-60% token cost reduction while maintaining output quality / Panduan ahli untuk kaskade dan routing model cerdas — routing tugas berbasis skor kompleksitas dari Flash/Haiku ke Sonnet/Opus/Astra, eskalasi dinamis dengan gerbang kualitas, pengurangan biaya token 40-60% dengan kualitas output terjaga.
日本語の概要は準備中です。原文の説明を表示しています。
Affective computing, emotion AI, and multimodal sentiment analysis / Komputasi afektif, AI emosional, dan analisis sentimen multimodal.
日本語の概要は準備中です。原文の説明を表示しています。