-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathMakefile
More file actions
1034 lines (849 loc) Β· 44.2 KB
/
Copy pathMakefile
File metadata and controls
1034 lines (849 loc) Β· 44.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# =============================================================================
# ABI Project Makefile
# =============================================================================
# Main entry points for the ABI (Agent-Based Intelligence) project
# This file organizes commands into logical categories for easy navigation
# =============================================================================
# CORE TARGETS (Primary entry points)
# =============================================================================
# Default target - starts the main ABI chat agent
.DEFAULT_GOAL := default
# Default target with help display
log_level=INFO
default: deps local-up airgap
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi AbiAgent
# Main help documentation - displays all available commands organized by category
help:
@echo "ABI Project Makefile Help"
@echo "=========================="
@echo ""
@echo "CORE TARGETS:"
@echo " default Show this help message and ensure dependencies"
@echo " deps Install all dependencies and set up environment"
@echo " chat Start generic agent (use: make chat agent=AgentName)"
@echo " help Show this help documentation"
@echo ""
@echo "DEPENDENCIES & ENVIRONMENT:"
@echo " uv Ensure uv package manager and Python 3.10 are installed"
@echo " .venv Create virtual environment and install dependencies"
@echo " .env Create environment file (auto-generated on first run)"
@echo " git-deps Set up git hooks for code quality checks"
@echo " install Install all dependencies (alternative to .venv)"
@echo " lock Update dependency lock files"
@echo " local-build Build all Docker containers defined in docker-compose.yml"
@echo ""
@echo "CHAT & AGENT COMMANDS:"
@echo " chat Start generic chat (default agent: AbiAgent, override: agent=AgentName)"
@echo " chat-abi-agent Start the main ABI conversational agent"
@echo ""
@echo "MARKETPLACE AI AGENTS:"
@echo " chat-chatgpt-agent Start ChatGPT-based agent"
@echo " chat-claude-agent Start Claude-based agent"
@echo " chat-deepseek-agent Start DeepSeek-based agent"
@echo " chat-gemini-agent Start Gemini-based agent"
@echo " chat-gemma-agent Start Gemma-based agent"
@echo " chat-grok-agent Start Grok-based agent"
@echo " chat-llama-agent Start Llama-based agent"
@echo " chat-mistral-agent Start Mistral-based agent"
@echo " chat-perplexity-agent Start Perplexity-based agent"
@echo " chat-qwen-agent Start Qwen-based agent"
@echo ""
@echo "MARKETPLACE APPLICATION AGENTS:"
@echo " chat-agicap-agent Start Agicap integration agent"
@echo " chat-airtable-agent Start Airtable integration agent"
@echo " chat-algolia-agent Start Algolia integration agent"
@echo " chat-arxiv-agent Start ArXiv integration agent"
@echo " chat-aws-agent Start AWS integration agent"
@echo " chat-bodo-agent Start Bodo integration agent"
@echo " chat-datagouv-agent Start DataGouv integration agent"
@echo " chat-exchangeratesapi-agent Start ExchangeRatesAPI integration agent"
@echo " chat-github-agent Start GitHub integration agent"
@echo " chat-gmail-agent Start Gmail integration agent"
@echo " chat-google-analytics-agent Start Google Analytics integration agent"
@echo " chat-google-calendar-agent Start Google Calendar integration agent"
@echo " chat-google-drive-agent Start Google Drive integration agent"
@echo " chat-google-maps-agent Start Google Maps integration agent"
@echo " chat-google-search-agent Start Google Search integration agent"
@echo " chat-google-sheets-agent Start Google Sheets integration agent"
@echo " chat-hubspot-agent Start HubSpot integration agent"
@echo " chat-instagram-agent Start Instagram integration agent"
@echo " chat-linkedin-agent Start LinkedIn integration agent"
@echo " chat-linkedin-kg-agent Start LinkedIn Knowledge Graph agent"
@echo " chat-mercury-agent Start Mercury integration agent"
@echo " chat-naas-agent Start Naas platform integration agent"
@echo " chat-nebari-agent Start Nebari integration agent"
@echo " chat-newsapi-agent Start NewsAPI integration agent"
@echo " chat-notion-agent Start Notion integration agent"
@echo " chat-openalex-agent Start OpenAlex integration agent"
@echo " chat-openrouter-agent Start OpenRouter integration agent"
@echo " chat-openweathermap-agent Start OpenWeatherMap integration agent"
@echo " chat-pennylane-agent Start Pennylane integration agent"
@echo " chat-postgres-agent Start PostgreSQL integration agent"
@echo " chat-powerpoint-agent Start PowerPoint integration agent"
@echo " chat-pubmed-agent Start PubMed integration agent"
@echo " chat-qonto-agent Start Qonto integration agent"
@echo " chat-salesforce-agent Start Salesforce integration agent"
@echo " chat-sanax-agent Start Sanax integration agent"
@echo " chat-sendgrid-agent Start SendGrid integration agent"
@echo " chat-sharepoint-agent Start SharePoint integration agent"
@echo " chat-slack-agent Start Slack integration agent"
@echo " chat-spotify-agent Start Spotify integration agent"
@echo " chat-stripe-agent Start Stripe integration agent"
@echo " chat-twilio-agent Start Twilio integration agent"
@echo " chat-whatsapp-business-agent Start WhatsApp Business integration agent"
@echo " chat-worldbank-agent Start World Bank integration agent"
@echo " chat-yahoofinance-agent Start Yahoo Finance integration agent"
@echo " chat-youtube-agent Start YouTube integration agent"
@echo " chat-zoho-agent Start Zoho integration agent"
@echo " pull-request-description Generate pull request description using AI"
@echo ""
@echo "MARKETPLACE DOMAIN AGENTS:"
@echo " chat-support-agent Start customer support specialized agent"
@echo ""
@echo "DEVELOPMENT SERVERS & TOOLS:"
@echo " api Start API server for local development (port 9879)"
@echo " api-prod Build and run production API server in Docker"
@echo " api-local Start local API server in Docker with volume mounting"
@echo " mcp Start MCP server (STDIO mode for Claude Desktop)"
@echo " mcp-http Start MCP server (HTTP mode on port 8000)"
@echo " mcp-test Run MCP server validation tests"
@echo " sparql-terminal Open interactive SPARQL terminal for knowledge graph"
@echo " oxigraph-admin Open Oxigraph administrative interface"
@echo " oxigraph-explorer Open Knowledge Graph Explorer web interface"
@echo ""
@echo "TESTING & QUALITY ASSURANCE:"
@echo " test Run all Python tests using pytest"
@echo " test-coverage Run tests with coverage reporting and badge generation"
@echo " test-ci Run basic tests for CI (no external dependencies)"
@echo " test-abi Run tests specifically for the abi library"
@echo " test-api Run API-specific tests"
@echo " test-local-embedded-core Run no-docker local embedded core e2e test"
@echo " test-integration-core Run core integration tests (testcontainers)"
@echo " test-api-init Test API initialization with production secrets"
@echo " test-api-init-container Test API initialization in containerized environment"
@echo " ftest Interactive test selector using fzf (fuzzy finder)"
@echo ""
@echo "CODE QUALITY & LINTING:"
@echo " check Run all code quality checks (core, custom, marketplace)"
@echo " check-core Run code quality checks for core modules"
@echo " check-marketplace Run code quality checks for marketplace modules"
@echo " check-nexus Build the Nexus web app to catch frontend errors"
@echo " fmt Format code using ruff"
@echo " bandit Run security scanning with bandit"
@echo " trivy-container-scan Run container security scanning with trivy"
@echo ""
@echo "PACKAGE MANAGEMENT:"
@echo " add Add dependency to main project (use: make add dep=package)"
@echo " abi-add Add dependency to abi library (use: make abi-add dep=package)"
@echo ""
@echo "DOCKER BUILD COMMANDS:"
@echo " build Build Docker image (alias for build.linux.x86_64)"
@echo " build.linux.x86_64 Build Docker image for Linux x86_64 architecture"
@echo ""
@echo "DOCKER COMPOSE MANAGEMENT:"
@echo " check-docker Check if Docker is running"
@echo " docker-cleanup Clean up Docker conflicts and stuck containers"
@echo " oxigraph-up Start Oxigraph knowledge graph database"
@echo " oxigraph-down Stop Oxigraph database"
@echo " oxigraph-status Check Oxigraph container status"
@echo " local-up Start all local development services"
@echo " local-logs View logs from all local services"
@echo " local-stop Stop all local services without removing containers"
@echo " local-down Stop and remove all local service containers"
@echo " local-reload Stop and remove all local service containers and restart them"
@echo " container-up Start ABI in container mode"
@echo " container-down Stop ABI container"
@echo " model-up Start Docker model for airgap AI operation"
@echo " model-down Stop Docker model"
@echo " model-status Check Docker model status"
@echo ""
@echo "DAGSTER DATA ORCHESTRATION:"
@echo " dagster-dev Start Dagster development server (foreground)"
@echo " dagster-up Start Dagster in background mode"
@echo " dagster-down Stop Dagster background service"
@echo " dagster-logs View Dagster service logs"
@echo " dagster-ui Open Dagster web interface"
@echo " dagster-status Check status of Dagster assets"
@echo " dagster-materialize Materialize all Dagster assets"
@echo ""
@echo "DATA MANAGEMENT & OPERATIONS:"
@echo " dvc-login Set up Data Version Control (DVC) authentication"
@echo " datastore-pull Pull datastore from remote storage"
@echo " datastore-push Push local datastore changes to remote storage"
@echo " storage-pull Pull storage data from remote"
@echo " storage-push Push local storage changes to remote"
@echo " ollama-models Pull local-first Ollama models (qwen2.5:3b + nomic-embed-text)"
@echo " triplestore-prod-remove Remove production triplestore data"
@echo " triplestore-prod-override Override production triplestore with local data"
@echo " triplestore-prod-pull Pull triplestore data from production environment"
@echo " triplestore-export-excel Export triplestore data to Excel format"
@echo " triplestore-export-turtle Export triplestore data to Turtle (RDF) format"
@echo ""
@echo "DOCUMENTATION & PUBLISHING:"
@echo " docs-ontology Generate ontology documentation"
@echo " publish-remote-agents Publish remote agents to workspace"
@echo " publish-remote-agents-dry-run Preview remote agent publishing (dry-run mode)"
@echo ""
@echo "CLEANUP & MAINTENANCE:"
@echo " clean Clean up build artifacts, caches, and Docker containers"
@echo ""
@echo "QUICK START:"
@echo " 1. make deps # Set up environment"
@echo " 2. make local-up # Start local services"
@echo " 3. make # Start ABI agent (default)"
@echo ""
@echo "TROUBLESHOOTING:"
@echo " If 'make' hangs or times out:"
@echo " 1. make docker-cleanup"
@echo " 2. make local-up"
@echo " 3. make"
@echo ""
@echo "DEFAULT TARGET:"
@echo " Running 'make' installs dependencies and starts the Abi"
@echo ""
# =============================================================================
# DEPENDENCIES & ENVIRONMENT SETUP
# =============================================================================
# Master dependency target - ensures all dependencies are satisfied
deps: uv git-deps .venv .env
# Ensure airgap model is running if AI_MODE=airgap
airgap:
@if grep -q "AI_MODE=airgap" .env 2>/dev/null; then \
echo "π€ Docker AI models managed by Compose specification"; \
echo "β Models will auto-start when services are launched"; \
fi
# Ensure uv package manager is installed and Python 3.10 is available
uv:
@if ! command -v uv >/dev/null 2>&1; then \
echo "π Oops! Looks like uv is missing from your system!"; \
echo "π Don't worry - you can get it here: https://docs.astral.sh/uv/getting-started/installation/"; \
exit 1; \
fi
# Create virtual environment and install all dependencies
.venv:
@ uv sync --all-extras
@ echo "π¦ Installing frontend dependencies..."
@ cd libs/naas-abi/naas_abi/apps/nexus/apps/web && pnpm install || echo "β οΈ pnpm not found - skipping frontend deps (install pnpm: https://pnpm.io)"
deps-upgrade:
@ uv sync --all-extras --upgrade
# Environment file will be created dynamically by CLI during first boot
.env:
@# .env will be created dynamically by CLI during first boot
# Set up git hooks for code quality checks before commits
.git/hooks/pre-commit:
@if [ -d .git ]; then \
mkdir -p .git/hooks \
&& echo 'cd "$(git rev-parse --show-toplevel)" || exit 1;make check' > .git/hooks/pre-commit \
&& chmod +x .git/hooks/pre-commit \
; fi
# Install git hooks as dependency
git-deps: .git/hooks/pre-commit
# Create symbolic link to allow importing lib.abi from the virtual environment
python_version=$(shell cat .python-version)
.venv/lib/python$(python_version)/site-packages/abi: deps
@[ -L .venv/lib/python$(python_version)/site-packages/abi ] || ln -s `pwd`/lib/abi .venv/lib/python$(python_version)/site-packages/abi
# Install dependencies (alternative to .venv)
install: dep
@ uv sync
# Update dependency lock files
lock: deps
@ uv lock
# Build local Docker containers
local-build: deps
@ docker compose build
# =============================================================================
# CHAT WITH CORE AGENTS
# =============================================================================
agent=AbiAgent
# Generic chat command - allows specifying agent via agent=AgentName parameter
chat: deps
@ LOG_LEVEL=DEBUG uv run abi chat $(module_name) $(agent_name)
# Main ABI agent - the primary conversational AI interface
chat-abi-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi AbiAgent
# =============================================================================
# CHAT WITH MARKETPLACE AI AGENTS
# =============================================================================
chat-chatgpt-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.ai.chatgpt ChatGPTAgent
chat-claude-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.ai.claude ClaudeAgent
chat-deepseek-agent: deps
@ LOG_LEVEL=DEBUG uv run abi chat naas_abi_marketplace.ai.deepseek DeepSeekAgent
chat-gemini-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.ai.gemini GeminiAgent
chat-gemma-agent: deps
@ LOG_LEVEL=DEBUG uv run abi chat naas_abi_marketplace.ai.gemma GemmaAgent
chat-grok-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.ai.grok GrokAgent
chat-llama-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.ai.llama LlamaAgent
chat-mistral-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.ai.mistral MistralAgent
chat-perplexity-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.ai.perplexity PerplexityAgent
chat-qwen-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.ai.qwen QwenAgent
# =============================================================================
# CHAT WITH MARKETPLACE APPLICATIONS AGENTS
# =============================================================================
chat-agicap-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.agicap AgicapAgent
chat-airtable-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.airtable AirtableAgent
chat-algolia-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.algolia AlgoliaAgent
chat-arxiv-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.arxiv ArXivAgent
chat-aws-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.aws AWSAgent
chat-bodo-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.bodo BodoAgent
chat-datagouv-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.datagouv DataGouvAgent
chat-exchangeratesapi-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.exchangeratesapi ExchangeRatesAPIAgent
chat-github-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.github GitHubAgent
chat-gmail-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.gmail GmailAgent
chat-gmail-draft-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.gmail GmailDraftAgent
chat-google-analytics-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.google_analytics GoogleAnalyticsAgent
chat-google-calendar-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.google_calendar GoogleCalendarAgent
chat-google-drive-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.google_drive GoogleDriveAgent
chat-google-maps-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.google_maps GoogleMapsAgent
chat-google-search-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.google_search GoogleSearchAgent
chat-google-sheets-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.google_sheets GoogleSheetsAgent
chat-hubspot-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.hubspot HubSpotAgent
chat-instagram-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.instagram InstagramAgent
chat-linkedin-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.linkedin LinkedInAgent
chat-linkedin-kg-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.linkedin LinkedInKGAgent
chat-mercury-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.mercury MercuryAgent
chat-naas-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.naas NaasAgent
chat-nebari-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.nebari NebariAgent
chat-newsapi-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.newsapi NewsAPIAgent
chat-notion-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.notion NotionAgent
chat-openalex-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.openalex OpenAlexAgent
chat-openrouter-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.openrouter OpenRouterAgent
chat-openweathermap-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.openweathermap OpenWeatherMapAgent
chat-pennylane-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.pennylane PennylaneAgent
chat-postgres-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.postgres PostgresAgent
chat-powerpoint-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.powerpoint PowerPointAgent
chat-pubmed-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.pubmed PubMedAgent
chat-qonto-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.qonto QontoAgent
chat-salesforce-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.salesforce SalesforceAgent
chat-sanax-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.sanax SanaxAgent
chat-sendgrid-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.sendgrid SendGridAgent
chat-sharepoint-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.sharepoint SharePointAgent
chat-slack-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.slack SlackAgent
chat-spotify-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.spotify SpotifyAgent
chat-stripe-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.stripe StripeAgent
chat-twilio-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.twilio TwilioAgent
chat-whatsapp-business-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.whatsapp_business WhatsAppBusinessAgent
chat-worldbank-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.worldbank WorldBankAgent
chat-yahoofinance-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.yahoofinance YfinanceAgent
chat-youtube-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.youtube YouTubeAgent
chat-zoho-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.zoho ZohoAgent
pull-request-description: deps
@ echo "generate the pull request description please." | LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.git PullRequestDescriptionAgent
commit:
@ echo "commit the changes please." | LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.git GitAgent
push:
@ echo "commit the changes if there are any and push them please." | LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.git GitAgent
pr:
@ echo "open the pull request or update it if it already exists please." | LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.applications.git GitAgent
# =============================================================================
# CHAT WITH MARKETPLACE DOMAINS AGENTS
# =============================================================================
chat-ontology-engineer-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.domains.operations.modules.ontology_engineer OntologyEngineerAgent
chat-process-ontology-engineer-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.domains.operations.modules.ontology_engineer ProcessOntologyEngineerAgent
chat-support-agent: deps
@ LOG_LEVEL=$(log_level) uv run abi chat naas_abi_marketplace.domains.operations.modules.support SupportAgent
# =============================================================================
# DEVELOPMENT SERVERS & TOOLS
# =============================================================================
# Start the main API server for local development
api: deps
# uv run src/api.py
@ LOG_LEVEL=DEBUG uv run python -m naas_abi_core.apps.api.api
# Start production API server in Docker container
api-prod: deps
@ docker build -t abi-prod -f docker/images/Dockerfile.linux.x86_64 . --platform linux/amd64
@ docker run --rm -it -p 9879:9879 --env-file .env -e ENV=prod --platform linux/amd64 abi-prod
# Start local API server in Docker container with volume mounting
api-local: deps
@ docker build -t abi-local -f docker/images/Dockerfile.linux.x86_64 . --platform linux/amd64
@ docker run --rm -it -p 9879:9879 -v ./storage:/app/storage --env-file .env -e ENV=dev --platform linux/amd64 abi-local
# MCP (Model Context Protocol) server for Claude Desktop integration
mcp: deps
@echo "π Starting MCP Server (STDIO mode for Claude Desktop)..."
uv run mcp-server
# MCP server in HTTP mode for web-based integration
mcp-http: deps
@echo "π Starting MCP Server (SSE mode on port 8000)..."
MCP_TRANSPORT=sse uv run mcp-server
# Run MCP server validation tests
mcp-test: deps
@echo "π Running MCP Server validation tests..."
uv run python -m src.mcp_server_test
# Interactive SPARQL terminal for querying the knowledge graph
sparql-terminal: deps
@ uv run python -m src.core.abi.apps.sparql_terminal.main
# Oxigraph administrative interface for database management
oxigraph-admin: deps
@ uv run python -m src.core.abi.apps.oxigraph_admin.main
# Knowledge Graph Explorer with integrated web interface
oxigraph-explorer:
@echo "π Opening Knowledge Graph Explorer..."
@echo "π Visit: http://localhost:7878/explorer/"
@echo "β¨ Features:"
@echo " β’ Interactive overview dashboard"
@echo " β’ Full-featured YasGUI SPARQL editor"
@echo " β’ Pre-built query library with explanations"
@command -v open >/dev/null 2>&1 && open "http://localhost:7878/explorer/" || echo "Open the URL manually in your browser"
# =============================================================================
# TESTING & QUALITY ASSURANCE
# =============================================================================
# Run all Python tests using pytest
path=tests/
test: deps
@ uv run python -m pytest .
# Run API-specific tests
test-api: deps
@ uv run python -m pytest libs/naas-abi-core/naas_abi_core/apps/api/api_test.py -v -s
# Run no-docker local embedded stack e2e test
test-local-embedded-core: deps
@ echo "π Running local embedded core e2e test..."
@ uv run pytest libs/naas-abi-core/naas_abi_core/engine/engine_configuration/EngineConfiguration_LocalEmbeddedE2E_test.py -v
# Run core integration tests using testcontainers
test-integration-core: deps check-docker
@ echo "π Running core integration tests (testcontainers)..."
@ cd libs/naas-abi-core && uv sync --all-extras && uv run pytest naas_abi_core/services/triple_store/adaptors/secondary/ApacheJenaTDB2_integration_test.py naas_abi_core/services/triple_store/adaptors/secondary/Oxigraph_integration_test.py -m integration -v
# Test API initialization with production secrets
test-api-init: deps
@ echo "π Testing API initialization with production secrets..."
@ uv run --no-dev python -m naas_abi_core.apps.api.test_init
# Test API initialization in containerized environment
test-api-init-container: build
@ echo "π Testing API initialization in container with production secrets..."
@ docker run --rm \
-e ABI_API_KEY="${ABI_API_KEY}" \
-e NAAS_API_KEY="${NAAS_API_KEY}" \
-e NAAS_CREDENTIALS_JWT_TOKEN="${NAAS_CREDENTIALS_JWT_TOKEN}" \
-e OPENAI_API_KEY="${OPENAI_API_KEY}" \
-e GITHUB_ACCESS_TOKEN="${GITHUB_ACCESS_TOKEN}" \
abi:latest uv run --no-dev python -m naas_abi_core.apps.api.test_init
TTL_FILES := $(shell find libs -name '*.ttl' -not -path '*/.venv/*' 2>/dev/null)
PY_FILES := $(patsubst %.ttl, %.py, $(TTL_FILES))
onto2py-force: onto2py-clean $(PY_FILES) onto2py-ruff-fix
onto2py-ruff-fix: $(PY_FILES)
@uv run ruff check --fix $(PY_FILES)
onto2py-clean:
@rm -f $(PY_FILES)
onto2py-list:
@echo $(PY_FILES)
onto2py: $(PY_FILES)
%.py: %.ttl
@printf "π¦ Converting ttl to py for $< ... "
@uv run python -m naas_abi_core.utils.onto2py.onto2py '$<'
# Test command for debugging
hello:
@echo 'hello' | make
# =============================================================================
# CODE QUALITY & LINTING
# =============================================================================
# Master check target - runs all code quality checks
check: deps check-core check-marketplace check-nexus
# Build Nexus web app to catch frontend build errors before commit
check-nexus: deps
@echo ""
@echo " _____ _____ _____ _____ _____ "
@echo " | | | | | |"
@echo " | N | E | X | U | S |"
@echo " |_____|_____|_____|_____|_____|"
@echo ""
@echo "\033[1;4mπ¨ Building Nexus web app...\033[0m\n"
@if [ ! -d libs/naas-abi/naas_abi/apps/nexus/apps/web/node_modules ]; then \
echo "π¦ node_modules missing β installing frontend dependencies..."; \
cd libs/naas-abi/naas_abi/apps/nexus/apps/web && pnpm install; \
fi
@cd libs/naas-abi/naas_abi/apps/nexus/apps/web && pnpm build
@echo "\nβ
NEXUS build passed!"
# Code quality checks for core modules
check-core: deps
@echo ""
@echo " _____ _____ _____ _____"
@echo " | | | | |"
@echo " | C | O | R | E |"
@echo " |_____|_____|_____|_____|"
@echo ""
@echo "\033[1;4mπ Running code quality checks...\033[0m\n"
@echo "π Linting with ruff..."
@uvx ruff check libs/naas-abi-core libs/naas-abi-cli libs/naas-abi --exclude "libs/naas-abi-cli/naas_abi_cli/cli/new/templates" --exclude "**/sandbox/**"
@echo "\n\033[1;4mπ Running static type analysis...\033[0m\n"
@echo "β’ Checking naas_abi_core..."
@cd libs/naas-abi-core && uv sync --all-extras && .venv/bin/mypy -p naas_abi_core --follow-untyped-imports --exclude '.*templates.*' --exclude '.*sandbox.*'
@echo "β’ Checking naas_abi_cli..."
@cd libs/naas-abi-cli && uv sync --all-extras && .venv/bin/mypy -p naas_abi_cli --follow-untyped-imports --exclude "naas_abi_cli/cli/new/templates" --exclude ".*sandbox.*"
@#uv run pyrefly check libs/naas-abi-core
@echo "\n\033[1;4mπ Running security checks (bandit)...\033[0m\n"
@uvx bandit -c bandit.yaml -r libs/naas-abi-core libs/naas-abi-cli libs/naas-abi -ll -ii
@echo "\nβ
CORE security checks passed!"
# Code quality checks for marketplace modules
package=naas_abi_marketplace
check-marketplace: deps
@echo ""
@echo " _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ "
@echo " | | | | | | | | | | | |"
@echo " | M | A | R | K | E | T | P | L | A | C | E |"
@echo " |_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|"
@echo ""
@echo "\n\033[1;4mπ Running code quality checks...\033[0m\n"
@echo "π Linting with ruff..."
@uvx ruff check libs/naas-abi-marketplace \
--exclude libs/naas-abi-marketplace/naas_abi_marketplace/domains \
--exclude libs/naas-abi-marketplace/naas_abi_marketplace/__demo__ \
--exclude libs/naas-abi-marketplace/naas_abi_marketplace/sandbox \
--exclude "**/sandbox/**"
@echo "\n\033[1;4mπ Running static type analysis...\033[0m\n"
cd libs/naas-abi-marketplace && uv sync --all-extras && uv run mypy -p $(package) \
--exclude 'naas_abi_marketplace/domains' \
--exclude 'naas_abi_marketplace/__demo__' \
--exclude 'naas_abi_marketplace/sandbox' \
--exclude 'naas_abi_marketplace/.*/sandbox' \
--exclude '.*sandbox.*' \
--follow-untyped-imports
@# echo "\nβ οΈ Skipping pyrefly checks (disabled)"
@# uv sync --all-extras && uv run pyrefly check libs/naas-abi-marketplace/naas_abi_marketplace/applications \
@echo "\nβ
MARKETPLACE security checks passed!"
# Code formatting with ruff
fmt: deps
@ uvx ruff format
# Security scanning with bandit
bandit:
@uvx bandit -c bandit.yaml -r libs/naas-abi-core libs/naas-abi-cli libs/naas-abi -ll -ii
# Container security scanning with trivy
trivy-container-scan: build
docker save abi:latest -o abi.tar && trivy image --input abi.tar && rm abi.tar
# =============================================================================
# PACKAGE MANAGEMENT
# =============================================================================
# Add dependency to the main project
add: deps
uv add $(dep)
# Add dependency to the abi library
add-abi: deps
cd libs/naas-abi && uv add $(dep)
# Add dependency to the naas-abi-cli library
add-cli: deps
cd libs/naas-abi-cli && uv add $(dep)
# Add dependency to the naas-abi-core library
add-core: deps
cd libs/naas-abi-core && uv add $(dep)
# Add dependency to the naas-abi-marketplace library
add-marketplace: deps
cd libs/naas-abi-marketplace && uv add $(dep)
# =============================================================================
# DOCKER BUILD COMMANDS
# =============================================================================
# Default build target - builds for Linux x86_64
build: build.linux.x86_64
# Build Docker image for Linux x86_64 architecture with size reporting
build.linux.x86_64: deps
DOCKER_BUILDKIT=1 docker build . -t abi -f docker/images/Dockerfile.linux.x86_64 --platform linux/amd64
@# Show container size
@docker image ls abi
# =============================================================================
# DOCKER COMPOSE MANAGEMENT
# =============================================================================
# Check if Docker is running before executing docker commands
check-docker:
@if ! docker info > /dev/null 2>&1; then \
echo "π³ Docker not running. Attempting to start..."; \
if [ "$$(uname)" = "Darwin" ]; then \
echo "π Starting Docker Desktop on macOS..."; \
open -a Docker && echo "β³ Waiting for Docker Desktop to start..." && sleep 10; \
for i in 1 2 3 4 5 6; do \
if docker info > /dev/null 2>&1; then \
echo "β
Docker Desktop started successfully!"; \
break; \
fi; \
echo "β³ Still waiting for Docker ($$i/6)..."; \
sleep 5; \
done; \
elif [ "$$(uname)" = "Linux" ]; then \
echo "π§ Starting Docker service on Linux..."; \
if command -v systemctl > /dev/null 2>&1; then \
sudo systemctl start docker && echo "β
Docker service started!"; \
elif command -v service > /dev/null 2>&1; then \
sudo service docker start && echo "β
Docker service started!"; \
else \
echo "β Cannot auto-start Docker. Please start Docker manually."; \
exit 1; \
fi; \
else \
echo "β Unsupported OS. Please start Docker manually."; \
exit 1; \
fi; \
if ! docker info > /dev/null 2>&1; then \
echo "β Docker failed to start. Please start Docker Desktop manually."; \
echo "π‘ After starting Docker, run: make docker-cleanup && make local-up"; \
exit 1; \
fi; \
fi
# Enhanced cleanup with conflict detection
docker-cleanup: check-docker
@echo "π§Ή Running Docker cleanup to prevent conflicts..."
@chmod +x ./docker/scripts/cleanup.sh 2>/dev/null || true
@./docker/scripts/cleanup.sh || ( \
echo "π§ Fallback cleanup for WSL/Windows..."; \
docker compose --profile local down --remove-orphans || true; \
docker container prune -f || true; \
docker network prune -f || true; \
echo "β
Cleanup complete"; \
)
# Start Oxigraph knowledge graph database
oxigraph-up: check-docker
@docker compose --profile local up -d oxigraph || (echo "β Failed to start Oxigraph. Try: make docker-cleanup"; exit 1)
@echo "β Oxigraph started on http://localhost:7878"
# Stop Oxigraph database
oxigraph-down: check-docker
@docker compose --profile local stop oxigraph || true
@echo "β Oxigraph stopped"
# Check Oxigraph container status
oxigraph-status: check-docker
@echo "Oxigraph status:"
@docker compose --profile local ps oxigraph
# Start all local development services
local-up: check-docker
@echo "π Starting local services..."
@if ! docker compose --profile local up -d --timeout 60; then \
echo "β Failed to start services. Running cleanup..."; \
./docker/scripts/cleanup.sh; \
echo "π Retrying..."; \
docker compose --profile local up -d --timeout 60 || (echo "β Still failing. Check Docker Desktop status."; exit 1); \
fi
@echo "β Local containers started"
@echo ""
@echo "π Local environment ready!"
@echo "β Services available at:"
@echo " - Oxigraph (Knowledge Graph): http://localhost:7878"
@echo " - YasGUI (SPARQL Editor): http://localhost:3000"
@echo " - PostgreSQL (Agent Memory): localhost:5432"
@echo " - Dagster (Orchestration): http://localhost:3001"
@echo " - Docker Models (Airgapped AI): ai/gemma3 ready via 'docker model run'"
# View logs from all local services
local-logs: check-docker
@docker compose --profile local logs -f
# Stop all local services without removing containers
local-stop: check-docker
@docker compose --profile local stop
@echo "β All local services stopped"
# Stop and remove all local service containers
local-down: check-docker
@docker compose --profile local down --timeout 10 || true
@echo "β All local services stopped"
local-clean: check-docker
@docker compose --profile local down -v --timeout 10 || true
@echo "β All local services stopped and volumes removed"
local-reload: check-docker
@docker compose --profile local down -v
@make local-up
@echo "β Local services reloaded"
# Start ABI in container mode
container-up:
@docker compose --profile container up -d
@echo "β ABI container started"
# Stop ABI container
container-down:
@docker compose --profile container down
@echo "β ABI container stopped"
# Docker AI models are managed by Compose specification
model-up: check-docker
@echo "π€ Docker AI models are managed by Compose specification"
@echo "π‘ Models auto-start when services with model dependencies launch"
@echo "β Use 'make container-up' to start services with AI models"
# Stop Docker AI models
model-down: check-docker
@echo "π Docker AI models are managed by Compose specification"
@echo "π‘ Models stop automatically when services are stopped"
@echo "β Use 'make container-down' to stop services and their models"
# Check Docker AI models status
model-status: check-docker
@echo "π€ Docker AI models status:"
@echo "π‘ Models are managed by Compose - check service status:"
@docker compose ps abi 2>/dev/null || echo "ABI service not running"
@echo "π‘ Available models:"
@docker model ls
# =============================================================================
# DAGSTER DATA ORCHESTRATION
# =============================================================================
# Start Dagster development server in foreground
dagster-dev:
@echo "π Starting Dagster development server..."
@docker compose --profile local up dagster
# Start Dagster in background mode
dagster-up:
@echo "π Starting Dagster in background..."
@docker compose --profile local up -d dagster
@echo "β Dagster started on http://localhost:3001"
@echo "π Logs: make dagster-logs"
# Stop Dagster background service
dagster-down:
@echo "π Stopping Dagster..."
@docker compose --profile local down dagster
@echo "β Dagster stopped"
# View Dagster service logs
dagster-logs:
@echo "π Showing Dagster logs..."
@docker compose --profile local logs -f dagster
# Open Dagster web interface
dagster-ui:
@echo "π Opening Dagster web interface..."
@echo "π Visit: http://localhost:3001"
@command -v open >/dev/null 2>&1 && open "http://localhost:3001" || echo "Open the URL manually in your browser"
@docker compose --profile local up dagster
# Check status of Dagster assets
dagster-status:
@echo "π Checking Dagster asset status..."
@docker compose --profile local exec dagster uv run dagster asset list -m src.marketplace.__demo__.orchestration.definitions
# Materialize all Dagster assets
dagster-materialize:
@echo "βοΈ Materializing all Dagster assets..."
@docker compose --profile local exec dagster uv run dagster asset materialize --select "*" -m src.marketplace.__demo__.orchestration.definitions
# =============================================================================
# DATA MANAGEMENT & OPERATIONS
# =============================================================================
# Set up Data Version Control (DVC) authentication
dvc-login: deps
@ uv run run python scripts/setup_dvc.py | sh
# Pull datastore from remote storage
datastore-pull: deps
@ echo "Pulling datastore..."
@ uv run --no-dev python scripts/datastore_pull.py | sh
# Push local datastore changes to remote storage
datastore-push: deps datastore-pull
@ echo "Pushing datastore..."
@ uv run --no-dev python scripts/datastore_push.py | sh
# Pull storage data from remote
storage-pull: deps
@ echo "Pulling storage..."
@ docker compose run --rm --remove-orphans abi bash -c 'uv run --no-dev python scripts/storage_pull.py | sh'
# Push local storage changes to remote
storage-push: deps storage-pull
@ echo "Pushing storage..."
@ docker compose run --rm --remove-orphans abi bash -c 'uv run --no-dev python scripts/storage_push.py | sh'
# Pull the local-first Ollama models (opt-in; not part of every boot/update).
ollama-models:
@ command -v ollama >/dev/null 2>&1 || { echo "ollama not found; install from https://ollama.com first"; exit 1; }
@ echo "Pulling qwen2.5:3b ..."
@ ollama pull qwen2.5:3b
@ echo "Pulling nomic-embed-text ..."
@ ollama pull nomic-embed-text
@ echo "Ollama models ready."
# Remove production triplestore data
triplestore-prod-remove: deps
@ echo "Removing production triplestore..."
@ docker compose run --rm --remove-orphans abi bash -c 'uv run --no-dev python scripts/triplestore_prod_remove.py'
# Override production triplestore with local data
triplestore-prod-override: deps
@ echo "Overriding production triplestore..."
@ docker compose run --rm --remove-orphans abi bash -c 'uv run --no-dev python scripts/triplestore_prod_override.py'
# Pull triplestore data from production environment
triplestore-prod-pull: deps
@ echo "Pulling production triplestore..."
@ docker compose run --rm --remove-orphans abi bash -c 'uv run --no-dev python scripts/triplestore_prod_pull.py'
# Export triplestore data to Excel format
triplestore-export-excel: deps
@ echo "Exporting triplestore to Excel..."
@ uv run python scripts/export_triplestore_excel.py
# Export triplestore data to Turtle (RDF) format
triplestore-export-turtle: deps
@ echo "Exporting triplestore to turtle..."
@ uv run python scripts/export_triplestore_turtle.py
# =============================================================================
# DOCUMENTATION & PUBLISHING
# =============================================================================
DOCS_PORT := 3003
# Serve docs locally with Docusaurus + live reload at http://localhost:$(DOCS_PORT)
docs:
@echo "β Starting docs dev server at http://localhost:$(DOCS_PORT)..."
@cd docs/site && npm install --silent && npm run start -- --port $(DOCS_PORT)
# Build docs for production
docs-build:
@echo "β Building docs..."
@cd docs/site && npm install --silent && npm run build
# Clean Docusaurus cache and build output
docs-clean:
@echo "β Cleaning docs build..."
@cd docs/site && npm run clear
@rm -rf docs/site/build
@echo "Done."
# Generate ontology documentation