Skip to content

Commit 0bb2b4a

Browse files
committed
docs(diagrams): Add comprehensive architecture diagrams with PNG/SVG exports
- 13 Mermaid diagrams covering all architecture views - Static diagrams: hierarchy, components, class, interface, state, flow, use case - Dynamic diagrams: 4 sequence diagrams for key workflows - Infrastructure: deployment and communication diagrams - Generated PNG (3000x2000) and SVG (scalable) exports - Automated generation scripts for PNG and SVG - README and GALLERY documentation for diagram navigation
1 parent 22ae214 commit 0bb2b4a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2101
-0
lines changed
Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
graph TB
2+
subgraph "User Layer"
3+
USER[User/Client]
4+
end
5+
6+
subgraph "Agent Orchestration Layer"
7+
DEEPAGENT[DeepAgent<br/>FlexibleAgent]
8+
EXECUTOR[LangChain<br/>AgentExecutor]
9+
TOOLREGISTRY[Tool Registry]
10+
end
11+
12+
subgraph "Tool Integration Layer"
13+
DOCTOOL[DocumentProcessingTool<br/>Tier 1: Basic]
14+
AITOOL[AIDocumentProcessingTool<br/>Tier 2: AI-Enhanced]
15+
SMARTTOOL[SmartDocumentProcessingTool<br/>Tier 3: Context-Aware]
16+
end
17+
18+
subgraph "Document Agent Layer"
19+
DOCAGENT[DocumentAgent<br/>Requirements Extraction]
20+
AIAGENT[AIDocumentAgent<br/>Semantic + Vision + NLP]
21+
TAGAGENT[TagAwareDocumentAgent<br/>Auto-Tagging + Routing]
22+
end
23+
24+
subgraph "Processing Components Layer"
25+
subgraph "Tagging & Routing"
26+
TAGGER[DocumentTagger<br/>Heuristic + LLM]
27+
PROMPTSEL[PromptSelector<br/>Domain-Specific]
28+
USERCONFIRM[User Confirmation<br/>UI/CLI]
29+
end
30+
31+
subgraph "Document Processing"
32+
DOCLING[Docling Parser<br/>PDF → Markdown]
33+
LLMSTRUCT[LLM Structuring<br/>Sections + Requirements]
34+
QUALITY[Quality Enhancements<br/>99-100% Accuracy]
35+
end
36+
37+
subgraph "AI Processing"
38+
SEMANTIC[SemanticAnalyzer<br/>Relationships + Topics]
39+
VISION[VisionProcessor<br/>Layout + Tables]
40+
NLP[NLP Engine<br/>Entities + Sentiment]
41+
end
42+
43+
subgraph "High-Accuracy Pipeline"
44+
HIREQPIPE[Requirements Pipeline<br/>&gt;99% Accuracy]
45+
MULTIPASS[Multi-Pass Validation]
46+
CROSSVAL[Cross-Validation]
47+
end
48+
end
49+
50+
subgraph "Knowledge & Persistence Layer"
51+
subgraph "Database Storage"
52+
POSTGRES[(PostgreSQL<br/>Structured Data)]
53+
PGVECTOR[(pgvector<br/>Embeddings)]
54+
end
55+
56+
subgraph "Knowledge Store"
57+
EXTKNOW[ExternalKnowledgeStore<br/>Standards + Templates]
58+
STANDARDS[Standards Graph<br/>Clause Relationships]
59+
end
60+
61+
subgraph "Embedding & Indexing"
62+
EMBEDGEN[EmbeddingGenerator<br/>Text → Vectors]
63+
INDEXMGR[Index Manager<br/>ivfflat + HNSW]
64+
end
65+
end
66+
67+
subgraph "Retrieval & RAG Layer"
68+
HYBRIDRAG[Hybrid Retriever<br/>Vector + Lexical]
69+
VECTORSEARCH[Vector Search<br/>Cosine Similarity]
70+
LEXICALSEARCH[Lexical Search<br/>BM25 + Full-Text]
71+
RERANKER[Re-Ranker<br/>Cross-Encoder]
72+
FUSION[Score Fusion<br/>RRF + Weighted]
73+
end
74+
75+
subgraph "Reasoning & Compliance Layer"
76+
COMPLIANCE[Compliance Engine<br/>Standards Validation]
77+
ANSWERSYN[Answer Synthesizer<br/>LLM + Context]
78+
GRAPHQUERY[Graph Query Engine<br/>Standards Relationships]
79+
end
80+
81+
subgraph "LLM Provider Layer"
82+
GEMINI[Google Gemini]
83+
OPENAI[OpenAI GPT-4]
84+
OLLAMA[Ollama Local]
85+
ANTHROPIC[Anthropic Claude]
86+
end
87+
88+
%% User to Agent
89+
USER --> DEEPAGENT
90+
91+
%% Agent Orchestration
92+
DEEPAGENT --> EXECUTOR
93+
EXECUTOR --> TOOLREGISTRY
94+
TOOLREGISTRY --> DOCTOOL
95+
TOOLREGISTRY --> AITOOL
96+
TOOLREGISTRY --> SMARTTOOL
97+
98+
%% Tools to Agents
99+
DOCTOOL --> DOCAGENT
100+
AITOOL --> AIAGENT
101+
SMARTTOOL --> TAGAGENT
102+
103+
%% Agent to Processing
104+
TAGAGENT --> TAGGER
105+
TAGAGENT --> PROMPTSEL
106+
TAGGER --> USERCONFIRM
107+
USERCONFIRM --> PROMPTSEL
108+
109+
DOCAGENT --> DOCLING
110+
DOCAGENT --> LLMSTRUCT
111+
DOCAGENT --> QUALITY
112+
113+
AIAGENT --> SEMANTIC
114+
AIAGENT --> VISION
115+
AIAGENT --> NLP
116+
117+
TAGAGENT --> HIREQPIPE
118+
HIREQPIPE --> MULTIPASS
119+
HIREQPIPE --> CROSSVAL
120+
121+
%% Processing to Knowledge
122+
QUALITY --> POSTGRES
123+
QUALITY --> EMBEDGEN
124+
HIREQPIPE --> POSTGRES
125+
126+
SEMANTIC --> EXTKNOW
127+
NLP --> EXTKNOW
128+
129+
EMBEDGEN --> PGVECTOR
130+
EMBEDGEN --> INDEXMGR
131+
INDEXMGR --> PGVECTOR
132+
133+
EXTKNOW --> STANDARDS
134+
STANDARDS --> POSTGRES
135+
136+
%% Retrieval Components
137+
HYBRIDRAG --> VECTORSEARCH
138+
HYBRIDRAG --> LEXICALSEARCH
139+
HYBRIDRAG --> FUSION
140+
141+
VECTORSEARCH --> PGVECTOR
142+
LEXICALSEARCH --> POSTGRES
143+
144+
FUSION --> RERANKER
145+
146+
%% Reasoning
147+
RERANKER --> COMPLIANCE
148+
RERANKER --> ANSWERSYN
149+
RERANKER --> GRAPHQUERY
150+
151+
COMPLIANCE --> STANDARDS
152+
GRAPHQUERY --> STANDARDS
153+
154+
ANSWERSYN --> DEEPAGENT
155+
COMPLIANCE --> DEEPAGENT
156+
GRAPHQUERY --> DEEPAGENT
157+
158+
%% LLM Providers
159+
DEEPAGENT -.-> GEMINI
160+
DEEPAGENT -.-> OPENAI
161+
DEEPAGENT -.-> OLLAMA
162+
DEEPAGENT -.-> ANTHROPIC
163+
164+
LLMSTRUCT -.-> GEMINI
165+
LLMSTRUCT -.-> OPENAI
166+
LLMSTRUCT -.-> OLLAMA
167+
168+
TAGGER -.-> GEMINI
169+
TAGGER -.-> OPENAI
170+
171+
ANSWERSYN -.-> GEMINI
172+
ANSWERSYN -.-> OPENAI
173+
ANSWERSYN -.-> ANTHROPIC
174+
175+
%% Styling
176+
classDef userLayer fill:#e1f5ff,stroke:#01579b,stroke-width:2px
177+
classDef agentLayer fill:#fff9c4,stroke:#f57f17,stroke-width:2px
178+
classDef toolLayer fill:#f3e5f5,stroke:#4a148c,stroke-width:2px
179+
classDef docAgentLayer fill:#e8f5e9,stroke:#1b5e20,stroke-width:2px
180+
classDef processLayer fill:#fff3e0,stroke:#e65100,stroke-width:2px
181+
classDef knowledgeLayer fill:#e0f2f1,stroke:#004d40,stroke-width:2px
182+
classDef ragLayer fill:#fce4ec,stroke:#880e4f,stroke-width:2px
183+
classDef reasoningLayer fill:#e8eaf6,stroke:#1a237e,stroke-width:2px
184+
classDef llmLayer fill:#efebe9,stroke:#3e2723,stroke-width:2px
185+
186+
class USER userLayer
187+
class DEEPAGENT,EXECUTOR,TOOLREGISTRY agentLayer
188+
class DOCTOOL,AITOOL,SMARTTOOL toolLayer
189+
class DOCAGENT,AIAGENT,TAGAGENT docAgentLayer
190+
class TAGGER,PROMPTSEL,USERCONFIRM,DOCLING,LLMSTRUCT,QUALITY,SEMANTIC,VISION,NLP,HIREQPIPE,MULTIPASS,CROSSVAL processLayer
191+
class POSTGRES,PGVECTOR,EXTKNOW,STANDARDS,EMBEDGEN,INDEXMGR knowledgeLayer
192+
class HYBRIDRAG,VECTORSEARCH,LEXICALSEARCH,RERANKER,FUSION ragLayer
193+
class COMPLIANCE,ANSWERSYN,GRAPHQUERY reasoningLayer
194+
class GEMINI,OPENAI,OLLAMA,ANTHROPIC llmLayer
368 KB
Loading

doc/design/diagrams/01_architecture_hierarchical.svg

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
graph LR
2+
subgraph "Document Ingestion Flow"
3+
A[User Uploads Document] --> B[SmartDocumentProcessingTool]
4+
B --> C[TagAwareDocumentAgent]
5+
C --> D[DocumentTagger]
6+
D --> E{Heuristic<br/>Analysis}
7+
E --> F{LLM<br/>Classification}
8+
F --> G[Tag Assignment<br/>requirements/standards/howto/template]
9+
G --> H[User Confirmation UI]
10+
H --> I{Tags<br/>Confirmed?}
11+
I -->|Yes| J[PromptSelector]
12+
I -->|No| K[User Manual Tagging]
13+
K --> J
14+
end
15+
16+
subgraph "Domain-Specific Processing"
17+
J --> L{Document<br/>Type?}
18+
L -->|Requirements| M[High-Accuracy Pipeline<br/>&gt;99% accuracy]
19+
L -->|Standards| N[Standards Extractor]
20+
L -->|HowTo| O[HowTo Processor]
21+
L -->|Template| P[Template Parser]
22+
23+
M --> M1[Multi-Pass Extraction]
24+
M1 --> M2[Cross-Validation]
25+
M2 --> M3[Confidence Scoring]
26+
M3 --> M4[Human Review Queue<br/>if confidence &lt; 0.99]
27+
28+
N --> N1[Clause Extraction]
29+
N1 --> N2[Standards Graph Building]
30+
31+
O --> O1[Step Extraction]
32+
O1 --> O2[Relationship Mapping]
33+
34+
P --> P1[Field Identification]
35+
P1 --> P2[Schema Extraction]
36+
end
37+
38+
subgraph "Structured Data Storage"
39+
M4 --> Q1[Requirements API<br/>POST /requirements/batch]
40+
N2 --> Q2[Standards API<br/>POST /standards]
41+
O2 --> Q3[Documents API<br/>POST /documents]
42+
P2 --> Q3
43+
44+
Q1 --> R1[(PostgreSQL<br/>requirements table)]
45+
Q2 --> R2[(PostgreSQL<br/>standards + graph)]
46+
Q3 --> R3[(PostgreSQL<br/>documents table)]
47+
end
48+
49+
subgraph "Embedding & Vector Storage"
50+
Q1 --> S1[EmbeddingGenerator]
51+
Q2 --> S1
52+
Q3 --> S1
53+
54+
S1 --> S2[Batch Embedding<br/>OpenAI/Local Model]
55+
S2 --> S3[pgvector Insert<br/>ivfflat index]
56+
S3 --> T1[(pgvector<br/>embeddings table)]
57+
end
58+
59+
subgraph "Hybrid RAG Retrieval"
60+
U[User Query] --> V[HybridRetriever]
61+
V --> W1[Vector Search<br/>cosine_similarity]
62+
V --> W2[Lexical Search<br/>BM25 + ts_rank]
63+
V --> W3[Metadata Filter<br/>doc_type + tags]
64+
65+
W1 --> T1
66+
W2 --> R1
67+
W2 --> R2
68+
W2 --> R3
69+
W3 --> R1
70+
W3 --> R2
71+
W3 --> R3
72+
73+
W1 --> X[Score Fusion<br/>RRF or Weighted]
74+
W2 --> X
75+
W3 --> X
76+
77+
X --> Y[Re-Ranker<br/>Cross-Encoder]
78+
Y --> Z[Top-K Results]
79+
end
80+
81+
subgraph "Reasoning & Compliance"
82+
Z --> AA{Query<br/>Type?}
83+
AA -->|Compliance Check| AB[ComplianceEngine]
84+
AA -->|Standards Q&A| AC[AnswerSynthesizer]
85+
AA -->|Relationship Query| AD[GraphQueryEngine]
86+
87+
AB --> AB1[Load Requirements]
88+
AB --> AB2[Load Standards]
89+
AB1 --> R1
90+
AB2 --> R2
91+
AB1 --> AB3[Compare Clauses]
92+
AB2 --> AB3
93+
AB3 --> AB4[Gap Analysis]
94+
AB4 --> AB5[Compliance Report]
95+
96+
AC --> AC1[Retrieve Context<br/>from Z]
97+
AC1 --> AC2[LLM Synthesis<br/>GPT-4/Gemini]
98+
AC2 --> AC3[Answer + Citations]
99+
100+
AD --> AD1[Query Standards Graph]
101+
AD1 --> R2
102+
AD1 --> AD2[Traverse Relationships]
103+
AD2 --> AD3[Build Relationship Map]
104+
end
105+
106+
subgraph "Response to User"
107+
AB5 --> AE[DeepAgent Response]
108+
AC3 --> AE
109+
AD3 --> AE
110+
AE --> AF[User Interface]
111+
end
112+
113+
%% Styling
114+
classDef ingestion fill:#e1f5ff,stroke:#01579b,stroke-width:2px
115+
classDef processing fill:#fff3e0,stroke:#e65100,stroke-width:2px
116+
classDef storage fill:#e0f2f1,stroke:#004d40,stroke-width:2px
117+
classDef embedding fill:#f3e5f5,stroke:#4a148c,stroke-width:2px
118+
classDef retrieval fill:#fce4ec,stroke:#880e4f,stroke-width:2px
119+
classDef reasoning fill:#e8eaf6,stroke:#1a237e,stroke-width:2px
120+
classDef response fill:#fff9c4,stroke:#f57f17,stroke-width:2px
121+
122+
class A,B,C,D,E,F,G,H,I,K ingestion
123+
class J,L,M,M1,M2,M3,M4,N,N1,N2,O,O1,O2,P,P1,P2 processing
124+
class Q1,Q2,Q3,R1,R2,R3 storage
125+
class S1,S2,S3,T1 embedding
126+
class U,V,W1,W2,W3,X,Y,Z retrieval
127+
class AA,AB,AB1,AB2,AB3,AB4,AB5,AC,AC1,AC2,AC3,AD,AD1,AD2,AD3 reasoning
128+
class AE,AF response
188 KB
Loading

doc/design/diagrams/02_component_interaction.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)