Skip to content

Commit 621be47

Browse files
Merge pull request #63 from vamplabAI/feature/frontend-integration
Feature/frontend integration
2 parents 50b0609 + f691723 commit 621be47

File tree

127 files changed

+21359
-8
lines changed

Some content is hidden

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

127 files changed

+21359
-8
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ downloads/
2626
eggs/
2727
.eggs/
2828
lib/
29+
!sgr-deep-research-frontend/src/shared/lib/
2930
lib64/
3031
parts/
3132
sdist/

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# SGR Agent Core — the first SGR open-source agentic framework for Schema-Guided Reasoning
22

3+
# UI For Testing
4+
5+
https://github.com/user-attachments/assets/aa85b4d9-b2cb-454c-97d0-ad1443ac9a59
6+
7+
[How run UI](https://github.com/vamplabAI/sgr-agent-core/blob/feature/frontend-integration/sgr-deep-research-frontend/README.md)
8+
39
## Description
410

511
![SGR Concept Architecture](docs/sgr_concept.png)

agents.yaml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# Example Custom Agents Configuration
2+
# =====================================
3+
# This file demonstrates how to define custom agents for SGR Deep Research
4+
5+
# Notes:
6+
# ------
7+
# 1. Agent names must be unique or will be overridden
8+
# 2. All tools must be registered in the tool registry
9+
# 3. LLM, Search, Prompts, Execution, MCP settings are optional and inherit from global config
10+
# 4. Agents override global settings by providing their own values
11+
12+
agents:
13+
# Example 1: Simple custom research agent with overrides
14+
custom_research_agent:
15+
base_class: "sgr_deep_research.core.SGRAgent"
16+
# Optional: Override LLM settings for this agent
17+
openai:
18+
model: "gpt-4o"
19+
temperature: 0.3
20+
max_tokens: 16000
21+
# api_key: "your-custom-api-key" # Optional: use different API key
22+
# base_url: "https://api.openai.com/v1" # Optional: use different endpoint
23+
# proxy: "http://127.0.0.1:8080" # Optional: use proxy
24+
25+
# Optional: Override search settings
26+
search:
27+
max_results: 15
28+
max_pages: 8
29+
content_limit: 2000
30+
31+
# Optional: Execution configuration
32+
execution:
33+
max_steps: 8
34+
max_iterations: 15
35+
max_clarifications: 5
36+
max_searches: 6
37+
mcp_context_limit: 20000
38+
logs_dir: "logs/custom_agent"
39+
reports_dir: "reports/custom_agent"
40+
41+
# Optional: MCP configuration
42+
mcp:
43+
mcpServers:
44+
deepwiki:
45+
url: "https://mcp.deepwiki.com/mcp"
46+
47+
# Tools this agent can use (must be registered in tool registry)
48+
tools:
49+
- "WebSearchTool"
50+
- "ExtractPageContentTool"
51+
- "CreateReportTool"
52+
- "ClarificationTool"
53+
- "GeneratePlanTool"
54+
- "AdaptPlanTool"
55+
- "FinalAnswerTool"
56+
57+
# Example 2: Minimal agent with defaults
58+
simple_agent:
59+
base_class: "SGRToolCallingResearchAgent"
60+
61+
# Only override what's needed
62+
llm:
63+
model: "gpt-4o-mini"
64+
65+
tools:
66+
- "WebSearchTool"
67+
- "FinalAnswerTool"
68+
69+
# Example 3: Fast research agent optimized for speed
70+
fast_research_agent:
71+
base_class: "SGRToolCallingAgent"
72+
73+
llm:
74+
model: "gpt-4o-mini"
75+
temperature: 0.1
76+
max_tokens: 4000
77+
78+
execution:
79+
max_steps: 4
80+
max_iterations: 8
81+
max_clarifications: 2
82+
max_searches: 3
83+
84+
tools:
85+
- "WebSearchTool"
86+
- "CreateReportTool"
87+
- "FinalAnswerTool"
88+
- "ReasoningTool"
89+
90+
# Example 4: Specialized technical analyst with custom prompts
91+
technical_analyst:
92+
base_class: "SGRAgent"
93+
94+
llm:
95+
model: "gpt-4o"
96+
temperature: 0.2
97+
98+
prompts:
99+
system_prompt: "You are a highly specialized technical analyst."
100+
101+
execution:
102+
max_steps: 10
103+
max_iterations: 20
104+
max_clarifications: 3
105+
max_searches: 8
106+
107+
tools:
108+
- "WebSearchTool"
109+
- "ExtractPageContentTool"
110+
- "CreateReportTool"
111+
- "ClarificationTool"
112+
- "FinalAnswerTool"
113+
114+
# Example 5: Agent using inline prompts instead of files
115+
inline_prompt_agent:
116+
base_class: "SGRResearchAgent"
117+
118+
prompts:
119+
system_prompt_str: |
120+
You are a helpful research assistant.
121+
Your goal is to provide accurate and concise information.
122+
initial_user_request_str: |
123+
User request: {user_request}
124+
Please analyze and respond.
125+
clarification_response_str: |
126+
I need clarification on: {clarification_needed}
127+
128+
tools:
129+
- "WebSearchTool"
130+
- "FinalAnswerTool"

services/README.md

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
# SGR Deep Research - Docker Deployment
2+
3+
Запуск полного стека (backend + frontend) через Docker Compose.
4+
5+
## Быстрый старт
6+
7+
1. **Скопируйте `.env.example` в `.env`:**
8+
9+
```bash
10+
cp .env.example .env
11+
```
12+
13+
2. **Отредактируйте `.env` при необходимости** (опционально)
14+
15+
3. **Запустите все сервисы:**
16+
17+
```bash
18+
docker-compose up -d --build
19+
```
20+
21+
4. **Откройте в браузере:**
22+
23+
- Frontend: http://localhost:5174
24+
- Backend API: http://localhost:8010
25+
- API Docs: http://localhost:8010/docs
26+
27+
## Управление
28+
29+
### Запуск
30+
31+
```bash
32+
# Запуск всех сервисов
33+
docker-compose up -d
34+
35+
# Запуск с пересборкой
36+
docker-compose up -d --build
37+
38+
# Запуск только backend
39+
docker-compose up -d sgr-backend
40+
41+
# Запуск только frontend
42+
docker-compose up -d sgr-frontend
43+
```
44+
45+
### Остановка
46+
47+
```bash
48+
# Остановить все сервисы
49+
docker-compose down
50+
51+
# Остановить и удалить volumes
52+
docker-compose down -v
53+
```
54+
55+
### Логи
56+
57+
```bash
58+
# Все логи
59+
docker-compose logs -f
60+
61+
# Логи backend
62+
docker-compose logs -f sgr-backend
63+
64+
# Логи frontend
65+
docker-compose logs -f sgr-frontend
66+
```
67+
68+
### Перезапуск
69+
70+
```bash
71+
# Перезапустить все
72+
docker-compose restart
73+
74+
# Перезапустить только backend
75+
docker-compose restart sgr-backend
76+
```
77+
78+
## Конфигурация
79+
80+
### Переменные окружения (.env)
81+
82+
```bash
83+
# Backend
84+
BACKEND_PORT=8010 # Порт для backend API
85+
86+
# Frontend
87+
FRONTEND_PORT=5174 # Порт для frontend
88+
VITE_API_BASE_URL=http://localhost:8010 # URL backend API
89+
VITE_APP_ENV=production # Окружение (production/development)
90+
91+
# Transcription API (опционально)
92+
VITE_TRANSCRIPTION_API_URL=https://speechcoreai.com/api
93+
VITE_TRANSCRIPTION_API_TOKEN=your_token_here
94+
```
95+
96+
### Структура сервисов
97+
98+
- **sgr-backend**: FastAPI backend на порту 8010
99+
100+
- Healthcheck: проверяет `/health` каждые 30 секунд
101+
- Volumes: код, конфиги, логи, отчеты
102+
103+
- **sgr-frontend**: Nginx + Vue.js frontend на порту 5174
104+
105+
- Зависит от backend (запускается после healthcheck)
106+
- Статические файлы собираются при сборке образа
107+
108+
### Сеть
109+
110+
Оба сервиса находятся в одной Docker сети `sgr-network`, что позволяет им взаимодействовать по именам контейнеров.
111+
112+
## Troubleshooting
113+
114+
### Frontend не может подключиться к backend
115+
116+
Проверьте, что `VITE_API_BASE_URL` в `.env` указывает на правильный URL backend.
117+
118+
### Backend не стартует
119+
120+
Проверьте логи:
121+
122+
```bash
123+
docker-compose logs sgr-backend
124+
```
125+
126+
Убедитесь, что `config.yaml` и `logging_config.yaml` существуют в корне проекта.
127+
128+
### Порты заняты
129+
130+
Измените порты в `.env`:
131+
132+
```bash
133+
BACKEND_PORT=8011
134+
FRONTEND_PORT=5175
135+
```
136+
137+
Затем перезапустите:
138+
139+
```bash
140+
docker-compose down
141+
docker-compose up -d
142+
```

services/docker-compose.yml

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,47 @@
11
services:
2-
sgr:
2+
sgr-backend:
33
build:
44
context: ./api_service
55
dockerfile: Dockerfile
6-
container_name: sgr-deep-research
6+
container_name: sgr-deep-research-backend
77
restart: unless-stopped
8-
98
ports:
10-
- "8010:8010"
9+
- "${BACKEND_PORT:-8010}:8010"
1110
volumes:
1211
- ../sgr_deep_research:/app/sgr_deep_research:ro
1312
- ../config.yaml:/app/config.yaml:ro
1413
- ../agents.yaml:/app/agents.yaml:ro
1514
- ../logging_config.yaml:/app/logging_config.yaml:ro
16-
- ./logs:/app/logs
17-
- ./reports:/app/reports
18-
15+
- ./logs:/app/logs
16+
- ./reports:/app/reports
1917
healthcheck:
2018
test: ["CMD", "curl", "-f", "http://localhost:8010/health"]
2119
interval: 30s
2220
timeout: 10s
2321
retries: 3
2422
start_period: 40s
23+
networks:
24+
- sgr-network
25+
26+
sgr-frontend:
27+
build:
28+
context: ../sgr-deep-research-frontend
29+
dockerfile: Dockerfile
30+
args:
31+
- VITE_API_BASE_URL=${VITE_API_BASE_URL:-http://localhost:8010}
32+
- VITE_APP_ENV=${VITE_APP_ENV:-production}
33+
- VITE_TRANSCRIPTION_API_URL=${VITE_TRANSCRIPTION_API_URL:-https://speechcoreai.com/api}
34+
- VITE_TRANSCRIPTION_API_TOKEN=${VITE_TRANSCRIPTION_API_TOKEN:-}
35+
container_name: sgr-deep-research-frontend
36+
restart: unless-stopped
37+
ports:
38+
- "${FRONTEND_PORT:-5173}:80"
39+
depends_on:
40+
sgr-backend:
41+
condition: service_healthy
42+
networks:
43+
- sgr-network
44+
45+
networks:
46+
sgr-network:
47+
driver: bridge
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# dependencies
2+
/node_modules
3+
.idea*
4+
5+
# production
6+
/dist
7+
8+
*.tar
9+
10+
# misc
11+
.DS_Store
12+
*.pem
13+
.vscode
14+
15+
# debug
16+
npm-debug.log*
17+
yarn-debug.log*
18+
yarn-error.log*
19+
20+
# typescript
21+
*.tsbuildinfo

0 commit comments

Comments
 (0)