Skip to content

Commit e8fcb1b

Browse files
committed
init
1 parent 250b0b5 commit e8fcb1b

15 files changed

+1411
-17
lines changed

.github/workflows/ghpages.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: ghpages.yml
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- framework-docs
7+
permissions:
8+
contents: write
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Configure Git Credentials
15+
run: |
16+
git config user.name github-actions[bot]
17+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
18+
- uses: actions/setup-python@v5
19+
with:
20+
python-version: 3.x
21+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
22+
- uses: actions/cache@v4
23+
with:
24+
key: mkdocs-material-${{ env.cache_id }}
25+
path: ~/.cache
26+
restore-keys: |
27+
mkdocs-material-
28+
- run: pip install \
29+
mkdocs-material \
30+
mkdocs-dracula-theme \
31+
mkdocs-material-extensions \
32+
mkdocs-get-deps
33+
- run: mkdocs gh-deploy --force

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ repos:
1313
- id: end-of-file-fixer
1414
- id: trailing-whitespace
1515
- id: check-yaml
16+
args: [--unsafe]
1617
- id: check-toml
1718
- id: check-docstring-first
1819
- id: check-executables-have-shebangs

docs/SGR-Agent's-Workflow.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
## 🧶 Agent Execution Sequence
2+
3+
The following diagram shows the complete SGR agent workflow with interruption and clarification support:
4+
5+
```mermaid
6+
sequenceDiagram
7+
participant Client
8+
participant API as FastAPI Server
9+
participant Agent as SGR Agent
10+
participant LLM as LLM
11+
participant Tools as Research Tools
12+
13+
Note over Client, Tools: SGR Agent Core - Agent Workflow
14+
15+
Client->>API: POST /v1/chat/completions<br/>{"model": "sgr_agent", "messages": [...]}
16+
17+
API->>Agent: Create new SGR Agent<br/>with unique ID
18+
Note over Agent: State: INITED
19+
20+
Agent->>Agent: Initialize context<br/>and conversation history
21+
22+
loop SGR Reasoning Loop (max 6 steps)
23+
Agent->>Agent: Prepare tools based on<br/>current context limits
24+
Agent->>LLM: Structured Output Request<br/>with NextStep schema
25+
26+
LLM-->>API: Streaming chunks
27+
API-->>Client: SSE stream with<br/>agent_id in model field
28+
29+
LLM->>Agent: Parsed NextStep result
30+
31+
alt Tool: Clarification
32+
Note over Agent: State: WAITING_FOR_CLARIFICATION
33+
Agent->>Tools: Execute clarification tool
34+
Tools->>API: Return clarifying questions
35+
API-->>Client: Stream clarification questions
36+
37+
Client->>API: POST /v1/chat/completions<br/>{"model": "agent_id", "messages": [...]}
38+
API->>Agent: provide_clarification()
39+
Note over Agent: State: RESEARCHING
40+
Agent->>Agent: Add clarification to context
41+
42+
else Tool: GeneratePlan
43+
Agent->>Tools: Execute plan generation
44+
Tools->>Agent: Research plan created
45+
46+
else Tool: WebSearch
47+
Agent->>Tools: Execute web search
48+
Tools->>Tools: Tavily API call
49+
Tools->>Agent: Search results + sources
50+
Agent->>Agent: Update context with sources
51+
52+
else Tool: AdaptPlan
53+
Agent->>Tools: Execute plan adaptation
54+
Tools->>Agent: Updated research plan
55+
56+
else Tool: CreateReport
57+
Agent->>Tools: Execute report creation
58+
Tools->>Tools: Generate comprehensive<br/>report with citations
59+
Tools->>Agent: Final research report
60+
61+
else Tool: ReportCompletion
62+
Note over Agent: State: COMPLETED
63+
Agent->>Tools: Execute completion
64+
Tools->>Agent: Task completion status
65+
end
66+
67+
Agent->>Agent: Add tool result to<br/>conversation history
68+
API-->>Client: Stream tool execution result
69+
70+
break Task Completed
71+
Agent->>Agent: Break execution loop
72+
end
73+
end
74+
75+
Agent->>API: Finish streaming
76+
API-->>Client: Close SSE stream
77+
78+
Note over Client, Tools: Agent remains accessible<br/>via agent_id for further clarifications
79+
```
80+
81+
## 🤖 Schema-Guided Reasoning Capabilities:
82+
83+
1. **🤔 Clarification** - clarifying questions when unclear
84+
2. **📋 Plan Generation** - research plan creation
85+
3. **🔍 Web Search** - internet information search
86+
4. **🔄 Plan Adaptation** - plan adaptation based on results
87+
5. **📝 Report Creation** - detailed report creation
88+
6. **✅ Final Answer** - task completion

docs/SGR-Demonstration.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## 🌏 Web Interface Video
2+
3+
https://github.com/user-attachments/assets/9e1c46c0-0c13-45dd-8b35-a3198f946451
4+
5+
## 🌎 Terminal CLI Video
6+
7+
https://github.com/user-attachments/assets/a5e34116-7853-43c2-ba93-2db811b8584a

0 commit comments

Comments
 (0)