Technical Reference¶
Technical reference documentation for CodeGraph API, agents, analysis modules, and database schema.
Overview¶
┌─────────────────────────────────────────────────────────────┐
│ Technical Reference │
├─────────────────────────────────────────────────────────────┤
│ API Reference │ Agent System │ Analysis Modules │
│ ├─ Programmatic │ ├─ Architecture │ ├─ CFGAnalyzer │
│ ├─ REST API │ ├─ 13 Agents │ ├─ DataFlowTracer │
│ └─ WebSocket │ └─ Workflows │ └─ TaintAnalysis │
├─────────────────────────────────────────────────────────────┤
│ Database Schema │ Workflows │ Security │
│ ├─ CPG Tables │ ├─ 20 Scenarios │ ├─ DLP/SIEM │
│ ├─ Indexes │ ├─ LangGraph │ ├─ Vault │
│ └─ Relationships │ └─ States │ └─ D3FEND │
└─────────────────────────────────────────────────────────────┘
Directory Structure¶
reference/
├── en/ # English reference documents
│ ├── API.md # Programmatic API reference
│ ├── AGENTS.md # Agent system architecture
│ ├── ANALYSIS_MODULES.md # CFGAnalyzer, DataFlowTracer
│ ├── SCHEMA.md # CPG database schema
│ ├── WORKFLOWS.md # Workflow definitions
│ ├── HYPOTHESIS_SYSTEM.md # Hypothesis generation
│ ├── SQL_QUERY_COOKBOOK.md # Example SQL queries
│ └── SECURITY.md # Security module reference
└── ru/ # Russian translations
└── README.md
Reference Documents¶
Core References¶
| Document |
Description |
| API Reference |
Programmatic API reference with Python examples |
| Agents |
13 specialized agents: architecture, roles, configuration |
| Analysis Modules |
CFGAnalyzer, FieldSensitiveTracer, DataFlowTracer |
| Database Schema |
CPG database schema: tables, indexes, relationships |
Advanced References¶
| Document |
Description |
| Workflows |
20 workflow scenarios: states, transitions, configuration |
| Hypothesis System |
Hypothesis generation and validation system |
| SQL Query Cookbook |
Example SQL queries for common analysis tasks |
| Security |
Security module: DLP, SIEM, Vault, D3FEND integration |
Key Topics¶
API Reference¶
from src.workflow import MultiScenarioCopilot
# Initialize copilot
copilot = MultiScenarioCopilot()
# Execute query
result = copilot.query(
user_input="Find SQL injection vulnerabilities",
scenario="security"
)
Agent System¶
13 specialized agents for different analysis tasks:
| Agent |
Purpose |
| SecurityAgent |
Vulnerability detection |
| PerformanceAgent |
Performance analysis |
| ArchitectureAgent |
Architecture analysis |
| RefactoringAgent |
Refactoring suggestions |
| DocumentationAgent |
Documentation generation |
Database Schema¶
Core CPG tables:
| Table |
Description |
nodes_method |
Function/method definitions (52K+ entries) |
nodes_call |
Function call sites (111K+ entries) |
edges_cfg |
Control flow edges |
edges_reaching_def |
Data flow edges (reaching definitions) |
edges_ast |
Abstract syntax tree edges |
Analysis Modules¶
| Module |
Purpose |
| CFGAnalyzer |
Control flow graph analysis |
| DataFlowTracer |
Data flow tracking |
| FieldSensitiveTracer |
Field-sensitive taint analysis |
| TaintAnalyzer |
Source-sink vulnerability detection |
Quick Reference¶
# Get method by name
method = cpg_service.get_method_by_name("heap_insert")
# Find callers
callers = cpg_service.get_callers("heap_insert")
# Trace data flow
flow = taint_analyzer.trace_data_flow(source="user_input", sink="sql_query")
# Run security analysis
vulns = security_agent.analyze(codebase_path="/path/to/code")