-
Notifications
You must be signed in to change notification settings - Fork 0
feat: LangGraph integration with observability and startup scripts #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
3537653
31a77f0
10e93fa
be42b8e
a000842
c22e7e0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,3 +39,8 @@ yarn-error.log* | |
| # typescript | ||
| *.tsbuildinfo | ||
| next-env.d.ts | ||
|
|
||
| # test results | ||
| /test-results | ||
| *.test-results.xml | ||
| *.lcov | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,141 @@ | ||||||||||||||||||||||
| # Smart Commerce Agent - Makefile | ||||||||||||||||||||||
| # | ||||||||||||||||||||||
| # One-command operations for development workflow | ||||||||||||||||||||||
| # | ||||||||||||||||||||||
| # Prerequisites: | ||||||||||||||||||||||
| # - Docker installed and running | ||||||||||||||||||||||
| # - pnpm (or npm/pip) for package management | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # Colors for output | ||||||||||||||||||||||
| GREEN=\033[0;32m | ||||||||||||||||||||||
| BLUE=\033[0;34m | ||||||||||||||||||||||
| YELLOW=\033[1;33m | ||||||||||||||||||||||
| NC=\033[0m | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| .PHONY: help | ||||||||||||||||||||||
| help: | ||||||||||||||||||||||
| @echo "" | ||||||||||||||||||||||
| @echo -e "$(BLUE)Smart Commerce Agent - Available Commands$(NC)" | ||||||||||||||||||||||
| @echo "" | ||||||||||||||||||||||
| @echo "Infrastructure:" | ||||||||||||||||||||||
| @echo " make infra-up Start all Docker infrastructure" | ||||||||||||||||||||||
| @echo " make infra-down Stop all infrastructure" | ||||||||||||||||||||||
| @echo " make infra-status Show status of all services" | ||||||||||||||||||||||
| @echo " make infra-restart Restart all infrastructure" | ||||||||||||||||||||||
| @echo "" | ||||||||||||||||||||||
| @echo "Development:" | ||||||||||||||||||||||
| @echo " make install Install dependencies (pnpm install)" | ||||||||||||||||||||||
| @echo " make dev Start development server" | ||||||||||||||||||||||
| @echo " make build Build for production" | ||||||||||||||||||||||
| @echo " make lint Run ESLint" | ||||||||||||||||||||||
| @echo " make typecheck Run TypeScript type checking" | ||||||||||||||||||||||
| @echo " make test Run test suite" | ||||||||||||||||||||||
| @echo " make test-watch Run tests in watch mode" | ||||||||||||||||||||||
| @echo "" | ||||||||||||||||||||||
| @echo "Database:" | ||||||||||||||||||||||
| @echo " make db-migrate Run database migrations" | ||||||||||||||||||||||
| @echo " make db-seed Seed database with sample data" | ||||||||||||||||||||||
| @echo " make db-reset Reset database (WARNING: deletes data)" | ||||||||||||||||||||||
| @echo "" | ||||||||||||||||||||||
| @echo "AI Services:" | ||||||||||||||||||||||
| @echo " make ollama-pull Pull required Ollama models" | ||||||||||||||||||||||
| @echo " make qdrant-init Initialize Qdrant with sample products" | ||||||||||||||||||||||
| @echo "" | ||||||||||||||||||||||
| @echo "Utilities:" | ||||||||||||||||||||||
| @echo " make clean Clean build artifacts and caches" | ||||||||||||||||||||||
| @echo " make docker-prune Remove unused Docker resources" | ||||||||||||||||||||||
| @echo "" | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # Infrastructure targets | ||||||||||||||||||||||
| .PHONY: infra-up infra-down infra-status infra-restart | ||||||||||||||||||||||
| infra-up: | ||||||||||||||||||||||
| @echo -e "$(YELLOW)Starting infrastructure...$(NC)" | ||||||||||||||||||||||
| @./scripts/start-infrastructure.sh start | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| infra-down: | ||||||||||||||||||||||
| @echo -e "$(YELLOW)Stopping infrastructure...$(NC)" | ||||||||||||||||||||||
| @./scripts/start-infrastructure.sh stop | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| infra-status: | ||||||||||||||||||||||
| @./scripts/start-infrastructure.sh status | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| infra-restart: | ||||||||||||||||||||||
| @echo -e "$(YELLOW)Restarting infrastructure...$(NC)" | ||||||||||||||||||||||
| @./scripts/start-infrastructure.sh restart | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # Development targets | ||||||||||||||||||||||
| .PHONY: install dev build lint typecheck test test-watch | ||||||||||||||||||||||
| install: | ||||||||||||||||||||||
| @echo -e "$(BLUE)Installing dependencies...$(NC)" | ||||||||||||||||||||||
| @pnpm install | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| dev: | ||||||||||||||||||||||
| @echo -e "$(BLUE)Starting development server...$(NC)" | ||||||||||||||||||||||
| @pnpm dev | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| build: | ||||||||||||||||||||||
| @echo -e "$(BLUE)Building for production...$(NC)" | ||||||||||||||||||||||
| @pnpm build | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| lint: | ||||||||||||||||||||||
| @echo -e "$(BLUE)Running ESLint...$(NC)" | ||||||||||||||||||||||
| @pnpm lint | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| typecheck: | ||||||||||||||||||||||
| @echo -e "$(BLUE)Running TypeScript type check...$(NC)" | ||||||||||||||||||||||
| @pnpm typecheck | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| test: | ||||||||||||||||||||||
| @echo -e "$(BLUE)Running tests...$(NC)" | ||||||||||||||||||||||
| @pnpm test | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| test-watch: | ||||||||||||||||||||||
| @echo -e "$(BLUE)Running tests in watch mode...$(NC)" | ||||||||||||||||||||||
| @pnpm test:watch | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # Database targets | ||||||||||||||||||||||
| .PHONY: db-migrate db-seed db-reset | ||||||||||||||||||||||
| db-migrate: | ||||||||||||||||||||||
| @echo -e "$(BLUE)Running database migrations...$(NC)" | ||||||||||||||||||||||
| @npx prisma migrate deploy | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| db-seed: | ||||||||||||||||||||||
| @echo -e "$(BLUE)Seeding database...$(NC)" | ||||||||||||||||||||||
| @npx tsx prisma/seed.ts | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| db-reset: | ||||||||||||||||||||||
| @echo -e "$(YELLOW)WARNING: This will delete all data in the database!$(NC)" | ||||||||||||||||||||||
| @read -p "Are you sure? (y/N) " -n 1 -r; echo; if [[ $$REPLY =~ ^[Yy]$$ ]]; then npx prisma migrate reset --force; fi | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # AI Services targets | ||||||||||||||||||||||
| .PHONY: ollama-pull qdrant-init | ||||||||||||||||||||||
| ollama-pull: | ||||||||||||||||||||||
| @echo -e "$(BLUE)Pulling Ollama models...$(NC)" | ||||||||||||||||||||||
| @docker exec sca-ollama ollama pull qwen2.5-coder:3b | ||||||||||||||||||||||
| @docker exec sca-ollama ollama pull nomic-embed-text | ||||||||||||||||||||||
|
Comment on lines
+114
to
+115
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||
| @echo -e "$(GREEN)Ollama models pulled successfully$(NC)" | ||||||||||||||||||||||
|
Comment on lines
+112
to
+116
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Check docker-compose.yml for Ollama service definition
echo "=== docker-compose.yml: Ollama-related entries ==="
rg -n "ollama" docker-compose.yml
echo ""
echo "=== Checking test-langgraph.sh for container references ==="
rg -n "ollama\|sca-ollama\|smart-commerce-ollama" scripts/test-langgraph.sh || echo "File not found or no matches"
echo ""
echo "=== Verifying Makefile lines 112-116 ==="
sed -n '110,120p' MakefileRepository: Aparnap2/smart_commerce_agent Length of output: 754 🏁 Script executed: #!/bin/bash
# Get full docker-compose.yml to see service definitions
echo "=== Full docker-compose.yml ==="
cat docker-compose.yml
echo ""
echo "=== List files in scripts directory ==="
ls -la scripts/ | head -20Repository: Aparnap2/smart_commerce_agent Length of output: 2262 🏁 Script executed: #!/bin/bash
# Check test-langgraph.sh for Ollama container references
echo "=== test-langgraph.sh: Ollama/container references ==="
rg -n "ollama\|sca-\|smart-commerce" scripts/test-langgraph.sh | head -30Repository: Aparnap2/smart_commerce_agent Length of output: 127 🏁 Script executed: #!/bin/bash
# Read test-langgraph.sh to check its content
cat scripts/test-langgraph.shRepository: Aparnap2/smart_commerce_agent Length of output: 10285 Container name mismatch in ollama-pull. 🔧 Proposed fix- `@docker` exec sca-ollama ollama pull qwen2.5-coder:3b
- `@docker` exec sca-ollama ollama pull nomic-embed-text
+ `@docker` exec smart-commerce-ollama ollama pull qwen2.5-coder:3b
+ `@docker` exec smart-commerce-ollama ollama pull nomic-embed-text📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| qdrant-init: | ||||||||||||||||||||||
| @echo -e "$(BLUE)Initializing Qdrant with sample products...$(NC)" | ||||||||||||||||||||||
| @pnpm tsx scripts/qdrant-seed.ts | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # Utility targets | ||||||||||||||||||||||
| .PHONY: clean docker-prune quick-start | ||||||||||||||||||||||
| clean: | ||||||||||||||||||||||
| @echo -e "$(BLUE)Cleaning build artifacts...$(NC)" | ||||||||||||||||||||||
| @rm -rf .next node_modules/.cache .turbo | ||||||||||||||||||||||
| @echo -e "$(GREEN)Cleaned successfully$(NC)" | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| docker-prune: | ||||||||||||||||||||||
| @echo -e "$(YELLOW)Pruning unused Docker resources...$(NC)" | ||||||||||||||||||||||
| @docker system prune -f | ||||||||||||||||||||||
| @docker volume prune -f | ||||||||||||||||||||||
| @echo -e "$(GREEN)Docker pruned successfully$(NC)" | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # Composite target for quick start | ||||||||||||||||||||||
| quick-start: infra-up install db-migrate db-seed | ||||||||||||||||||||||
| @echo "" | ||||||||||||||||||||||
| @echo -e "$(GREEN)========================================$(NC)" | ||||||||||||||||||||||
| @echo -e "$(GREEN) Quick start complete!$(NC)" | ||||||||||||||||||||||
| @echo -e "$(GREEN) Run 'make dev' to start the app$(NC)" | ||||||||||||||||||||||
| @echo -e "$(GREEN)========================================$(NC)" | ||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -193,7 +193,7 @@ async function executeWebSearchTool(query: string): Promise<ToolResult> { | |
|
|
||
| try { | ||
| // Use RAG document search instead of simulated web search | ||
| const { documentSearch } = await import('../../../lib/rag/service.ts'); | ||
| const { documentSearch } = await import('../../../lib/rag/service'); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| const result = await documentSearch(query, { | ||
| limit: 5, | ||
|
|
@@ -245,7 +245,7 @@ async function executeSemanticSearchTool(query: string, userId: string): Promise | |
|
|
||
| try { | ||
| // Use RAG vector search instead of simulated results | ||
| const { vectorSearch } = await import('../../../lib/rag/service.ts'); | ||
| const { vectorSearch } = await import('../../../lib/rag/service'); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| const result = await vectorSearch(query, { | ||
| limit: 10, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: Aparnap2/smart_commerce_agent
Length of output: 55
🏁 Script executed:
Repository: Aparnap2/smart_commerce_agent
Length of output: 996
🏁 Script executed:
Repository: Aparnap2/smart_commerce_agent
Length of output: 55
🏁 Script executed:
Repository: Aparnap2/smart_commerce_agent
Length of output: 55
🏁 Script executed:
Repository: Aparnap2/smart_commerce_agent
Length of output: 55
db-reset uses bashisms that fail under /bin/sh. Line 108 relies on
read -p,[[ ]], and$$REPLY =~, which are bash-specific. Make defaults to/bin/shwhenSHELLis not set. AddSHELL := /bin/bashto the top of the Makefile to ensure consistent execution.🛠️ Suggested fix
🤖 Prompt for AI Agents