Skip to content

Commit 3be2382

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent af538e6 commit 3be2382

11 files changed

Lines changed: 138 additions & 108 deletions

File tree

EdgeCraftRAG/docs/Advanced_Setup.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Before started, please prepare models into MODEL_PATH and prepare docker images
9696

9797
```bash
9898
export MODEL_PATH="${PWD}/models" # Your model path
99-
export LLM_MODEL="Qwen/Qwen3-30B-A3B"
99+
export LLM_MODEL="Qwen/Qwen3-30B-A3B"
100100
ip_address=$(hostname -I | awk '{print $1}')
101101
# Use `ip a` to check your active ip
102102
export HOST_IP=$ip_address # Your host ip
@@ -119,7 +119,7 @@ chown 1000:1000 ${MODEL_PATH} ${DOC_PATH} ${TMPFILE_PATH}
119119
chown 1000:1000 -R $HOME/.cache
120120
```
121121

122-
### Deploy the Service on Arc B60 Using Docker Compose
122+
### Deploy the Service on Arc B60 Using Docker Compose
123123

124124
```bash
125125
# vLLM envs

EdgeCraftRAG/docs/Agentic_RAG_Guide.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,25 @@
33
This guide explains how to enable, configure, and use Agent capabilities within EdgeCraftRAG (EC-RAG). It covers the creation and management of different agent types to enhance retrieval and generation workflows.(Currently, EC-RAG Agent is an experimental option.)
44

55
## Overview
6+
67
EC-RAG introduces autonomous agents that can perform complex reasoning, planning to answer queries more effectively than standard RAG pipelines.
78

89
EC-RAG currently supports two types of agents:
10+
911
- **Simple Agent**: A lightweight agent designed for straightforward tasks and direct query answering.
1012
- **Deep Search Agent**: An advanced agent capable of multi-step planning, deep research, and reasoning.
1113

1214
## Creating an Agent
1315

1416
### Prerequisites
17+
1518
To use agents in EC-RAG, please ensure the following prerequisites are met:
16-
1. Ensure the standard EC-RAG services are running and the UI is accessible.
19+
20+
1. Ensure the standard EC-RAG services are running and the UI is accessible.
1721
2. Agents require vLLM serving, please ensure pipelines utilizing vLLM serving are available.
1822

1923
### Creating a Simple Agent
24+
2025
To create a Simple Agent, you need to switch to `Agents` tab in the `Settings` page and click `Create Agent` button.
2126
![alt text](../assets/img/agent_tab.png)
2227

@@ -27,32 +32,36 @@ After selecting `Simple`, pipeline selection and Agent configuration will be ava
2732
![alt text](../assets/img/agent_config_simple.png)
2833

2934
### Creating a Deep Search Agent
35+
3036
To create a Deep Search Agent, switch to `Agents` tab and click `Create Agent` button. In `Create Agent` window, set `Agent Type` as `Deep Search`.
3137
![alt text](../assets/img/agent_create_deep-search.png)
3238

3339
Similarly, please select the pipeline with vLLM serving (generator type `FreeChat`) in `Pipeline Name`. In `Agent Configs` session, 5 parameters coudl be customized: `Retrieve Top K`, `Rerank Top K`, `Mece Retrival`, `Max Retrivals` and `Max Plan Steps`. If `Mece Retrival` is enabled, agent will not retrieve chunks already retrieved in each step.
3440
![alt text](../assets/img/agent_config_deep-search.png)
3541

3642
## Using Agents in RAG Pipelines
43+
3744
When agents were created successfully, they will be listed under `Agents` tab.
3845
![alt text](../assets/img/agent_tab_with_agents.png)
3946

4047
Then we can switch to `Chat` page to use the agents we created. They will be listed under `Agents` section of `Chat` page.
4148
![alt text](../assets/img/agent_chat.png)
4249

4350
### Simple Agent
51+
4452
Select the Simple agent we created, `Think` function will be locked in dialog window as `Think` is mandatory for agents. While Simple agent is working, it will decide if more information is needed, and generate new query if so.
4553
![alt text](../assets/img/agent_simple_working.png)
4654

4755
### DeepSearch Agent
56+
4857
Select DeepSearch agent from the `Agents` section. If we're going to switch between different agents, previous will be close.
4958
![alt text](../assets/img/agent_switching.png)
5059

51-
Agent could also be deactived by single-click on the activated agent.
60+
Agent could also be deactivated by single-click on the activated agent.
5261
![alt text](../assets/img/agent_deactivate.png)
5362

5463
While DeepSearch agent is working, it will make plans on its own and execute the plan step by step.
5564
![alt text](../assets/img/agent_deepsearch_plan.png)
5665

5766
When all planned steps completed, DeepSearch agent will generate the final answer.
58-
![alt text](../assets/img/agent_deepsearch_answer.png)
67+
![alt text](../assets/img/agent_deepsearch_answer.png)

EdgeCraftRAG/docs/Agentic_RAG_Guide_Zh.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,63 @@
11
# EC-RAG智能体指南
2+
23
目前,EC-RAG智能体将作为试用版功能开放体验。
34
本指南将为您介绍如何在 EdgeCraftRAG (EC-RAG) 中启用、配置和使用智能体(Agent)功能,涵盖不同类型智能体的创建和管理。
45

5-
66
## 概述
7+
78
EC-RAG现已支持创建智能体,这些智能体能够执行复杂的推理、规划,从而能够比未使用智能体的RAG更准确地为您提供回答。
89
EC-RAG目前支持两种类型的智能体:
10+
911
- **Simple Agent**: 不包含规划、research的简单轻量级Agent;
1012
- **Deep Search Agent**: 能够进行多步规划、deep research和深度推理的更高级版本Agent。
1113

1214
## Retrieval
1315

1416
### 前提条件
17+
1518
要在EC-RAG中使用智能体,您需要确保满足以下前提条件:
19+
1620
1. 确保EC-RAG完整服务正在运行,并且UI可以访问;
1721
2. Agent需要vLLM的大模型作为后端服务,请确保EC-RAG中以vLLM作为后端的pipeline处于可用状态。
1822

1923
### 创建Simple Agent智能体
20-
当您需要创建Simple Agent时,需要在`配置`页面切换到`智能体`选项卡,点击`创建智能体`按钮。
24+
25+
当您需要创建Simple Agent时,需要在`配置`页面切换到`智能体`选项卡,点击`创建智能体`按钮。
2126
![alt text](../assets/img/agent_tab_zh.png)
2227

2328
然后在`创建智能体`窗口中,将`智能体类型`设置为`simple`
2429
![alt text](../assets/img/agent_create_simple_zh.png)
2530

26-
选择`simple`后,窗口内将出现`pipeline名称``智能体配置`两个可选项。请您选择带有 vLLM 服务且生成器类型为`FreeChat`的pipeline,并在`智能体配置`中,根据您的需要指定`Max Retrievals`
31+
选择`simple`后,窗口内将出现`pipeline名称``智能体配置`两个可选项。请您选择带有 vLLM 服务且生成器类型为`FreeChat`的pipeline,并在`智能体配置`中,根据您的需要指定`Max Retrievals`
2732
![alt text](../assets/img/agent_config_simple_zh.png)
2833

2934
### 创建Deep Search Agent智能体
30-
当您需要创建深度搜索代理时,同样,请切换到`智能体`选项卡,并点击`创建智能体`按钮。在`创建智能体`窗口中,将`智能体类型`设置为`Deep Search`
35+
36+
当您需要创建深度搜索代理时,同样,请切换到`智能体`选项卡,并点击`创建智能体`按钮。在`创建智能体`窗口中,将`智能体类型`设置为`Deep Search`
3137
![alt text](../assets/img/agent_create_deep-search_zh.png)
3238

3339
`pipeline名称``智能体配置`两个可选项出现后,请选择带有 vLLM 服务且生成器类型为`FreeChat`的pipeline。对于Deep Search智能体,在`智能体配置`部分,可以自定义 5 个参数:`Retrieve Top K``Rerank Top K``Mece Retrieval``Max Retrievals``Max Plan Steps`。如果您启用了`Mece Retrieval`,智能体在每次行进retrieve时,将不会重复拿取之前的chunck。
3440
![alt text](../assets/img/agent_config_deep-search_zh.png)
3541

3642
## 在RAG中使用智能体
43+
3744
当您成功创建智能体后,它们将在`智能体`选项卡下列出。
3845
![alt text](../assets/img/agent_tab_with_agents_zh.png)
3946

4047
此时,您可以切换到`对话`页面,来使用刚才创建的智能体。它们将在`对话`页面的`智能体`部分列出。
4148
![alt text](../assets/img/agent_chat.png)
4249

4350
### 使用Simple Agent智能体
51+
4452
`思考`功能对于智能体来说是必须的,所以您会注意到,当您选择创建的Simple Agent后,对话框中的`思考`选项会被锁定。当Simple Agent正常工作时,它会判断回答是否足够、是否需要更多信息。
4553
![alt text](../assets/img/agent_simple_working_zh.png)
4654

4755
### 使用Deep Research智能体
48-
`智能体`部分选择您创建的DeepResearch智能体。您会注意到,如果您在不同智能体之间切换,之前的智能体将自动变为未激活状态。
56+
57+
`智能体`部分选择您创建的DeepResearch智能体。您会注意到,如果您在不同智能体之间切换,之前的智能体将自动变为未激活状态。
4958
![alt text](../assets/img/agent_switching_zh.png)
5059

51-
您也可以通过单击已激活的智能体来停用它。
60+
您也可以通过单击已激活的智能体来停用它。
5261
![alt text](../assets/img/agent_deactivate_zh.png)
5362

5463
当Deep Research智能体正常工作时,它会自主进行回答规划并按需求逐步执行,并最终生成答案。

EdgeCraftRAG/edgecraftrag/components/model.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,15 @@ def ser_model(self):
4848

4949
class OpenAIEmbeddingModel(BaseModelComponent, OpenAIEmbedding):
5050
def __init__(self, model_id, api_base, **kwargs):
51-
api_base = api_base+"/v1" if api_base and not api_base.endswith("/v1") else api_base
51+
api_base = api_base + "/v1" if api_base and not api_base.endswith("/v1") else api_base
5252
super().__init__(
5353
model_id=model_id,
5454
api_base=api_base,
5555
**kwargs,
5656
)
57-
OpenAIEmbedding.__init__(self, model_id_or_path=model_id, model_name=model_id, api_base=api_base, api_key="unused")
57+
OpenAIEmbedding.__init__(
58+
self, model_id_or_path=model_id, model_name=model_id, api_base=api_base, api_key="unused"
59+
)
5860
self.comp_type = CompType.MODEL
5961
self.comp_subtype = ModelType.VLLM_EMBEDDING
6062
self.model_id = model_id

EdgeCraftRAG/edgecraftrag/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def get_prompt_template(model_path, prompt_content=None, template_path=None, ena
4545
if prompt_content is not None:
4646
template = prompt_content
4747
elif template_path is not None:
48-
# Safely load the template only if it is inside /templates (or other safe root)
48+
# Safely load the template only if it is inside /templates (or other safe root)
4949
safe_root = "/templates"
5050
normalized_path = os.path.normpath(os.path.join(safe_root, template_path))
5151
if not normalized_path.startswith(safe_root):

EdgeCraftRAG/ui/vue/components.d.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
// Copyright (C) 2025 Intel Corporation
2+
// SPDX-License-Identifier: Apache-2.0
3+
14
/* eslint-disable */
25
// @ts-nocheck
36
// Generated by unplugin-vue-components
47
// Read more: https://github.com/vuejs/core/pull/3399
5-
export {}
8+
export {};
69

710
/* prettier-ignore */
811
declare module 'vue' {
Lines changed: 93 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (C) 2025 Intel Corporation
2+
// SPDX-License-Identifier: Apache-2.0
3+
14
/* eslint-disable */
25
/* prettier-ignore */
36
// @ts-nocheck
@@ -6,83 +9,98 @@
69
// biome-ignore lint: disable
710
export {}
811
declare global {
9-
const EffectScope: typeof import('vue')['EffectScope']
10-
const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate']
11-
const computed: typeof import('vue')['computed']
12-
const createApp: typeof import('vue')['createApp']
13-
const createPinia: typeof import('pinia')['createPinia']
14-
const customRef: typeof import('vue')['customRef']
15-
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
16-
const defineComponent: typeof import('vue')['defineComponent']
17-
const defineStore: typeof import('pinia')['defineStore']
18-
const effectScope: typeof import('vue')['effectScope']
19-
const getActivePinia: typeof import('pinia')['getActivePinia']
20-
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
21-
const getCurrentScope: typeof import('vue')['getCurrentScope']
22-
const h: typeof import('vue')['h']
23-
const inject: typeof import('vue')['inject']
24-
const isProxy: typeof import('vue')['isProxy']
25-
const isReactive: typeof import('vue')['isReactive']
26-
const isReadonly: typeof import('vue')['isReadonly']
27-
const isRef: typeof import('vue')['isRef']
28-
const mapActions: typeof import('pinia')['mapActions']
29-
const mapGetters: typeof import('pinia')['mapGetters']
30-
const mapState: typeof import('pinia')['mapState']
31-
const mapStores: typeof import('pinia')['mapStores']
32-
const mapWritableState: typeof import('pinia')['mapWritableState']
33-
const markRaw: typeof import('vue')['markRaw']
34-
const nextTick: typeof import('vue')['nextTick']
35-
const onActivated: typeof import('vue')['onActivated']
36-
const onBeforeMount: typeof import('vue')['onBeforeMount']
37-
const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave']
38-
const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate']
39-
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
40-
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
41-
const onDeactivated: typeof import('vue')['onDeactivated']
42-
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
43-
const onMounted: typeof import('vue')['onMounted']
44-
const onRenderTracked: typeof import('vue')['onRenderTracked']
45-
const onRenderTriggered: typeof import('vue')['onRenderTriggered']
46-
const onScopeDispose: typeof import('vue')['onScopeDispose']
47-
const onServerPrefetch: typeof import('vue')['onServerPrefetch']
48-
const onUnmounted: typeof import('vue')['onUnmounted']
49-
const onUpdated: typeof import('vue')['onUpdated']
50-
const onWatcherCleanup: typeof import('vue')['onWatcherCleanup']
51-
const provide: typeof import('vue')['provide']
52-
const reactive: typeof import('vue')['reactive']
53-
const readonly: typeof import('vue')['readonly']
54-
const ref: typeof import('vue')['ref']
55-
const resolveComponent: typeof import('vue')['resolveComponent']
56-
const setActivePinia: typeof import('pinia')['setActivePinia']
57-
const setMapStoreSuffix: typeof import('pinia')['setMapStoreSuffix']
58-
const shallowReactive: typeof import('vue')['shallowReactive']
59-
const shallowReadonly: typeof import('vue')['shallowReadonly']
60-
const shallowRef: typeof import('vue')['shallowRef']
61-
const storeToRefs: typeof import('pinia')['storeToRefs']
62-
const toRaw: typeof import('vue')['toRaw']
63-
const toRef: typeof import('vue')['toRef']
64-
const toRefs: typeof import('vue')['toRefs']
65-
const toValue: typeof import('vue')['toValue']
66-
const triggerRef: typeof import('vue')['triggerRef']
67-
const unref: typeof import('vue')['unref']
68-
const useAttrs: typeof import('vue')['useAttrs']
69-
const useCssModule: typeof import('vue')['useCssModule']
70-
const useCssVars: typeof import('vue')['useCssVars']
71-
const useId: typeof import('vue')['useId']
72-
const useLink: typeof import('vue-router')['useLink']
73-
const useModel: typeof import('vue')['useModel']
74-
const useRoute: typeof import('vue-router')['useRoute']
75-
const useRouter: typeof import('vue-router')['useRouter']
76-
const useSlots: typeof import('vue')['useSlots']
77-
const useTemplateRef: typeof import('vue')['useTemplateRef']
78-
const watch: typeof import('vue')['watch']
79-
const watchEffect: typeof import('vue')['watchEffect']
80-
const watchPostEffect: typeof import('vue')['watchPostEffect']
81-
const watchSyncEffect: typeof import('vue')['watchSyncEffect']
12+
const EffectScope: (typeof import("vue"))["EffectScope"];
13+
const acceptHMRUpdate: (typeof import("pinia"))["acceptHMRUpdate"];
14+
const computed: (typeof import("vue"))["computed"];
15+
const createApp: (typeof import("vue"))["createApp"];
16+
const createPinia: (typeof import("pinia"))["createPinia"];
17+
const customRef: (typeof import("vue"))["customRef"];
18+
const defineAsyncComponent: (typeof import("vue"))["defineAsyncComponent"];
19+
const defineComponent: (typeof import("vue"))["defineComponent"];
20+
const defineStore: (typeof import("pinia"))["defineStore"];
21+
const effectScope: (typeof import("vue"))["effectScope"];
22+
const getActivePinia: (typeof import("pinia"))["getActivePinia"];
23+
const getCurrentInstance: (typeof import("vue"))["getCurrentInstance"];
24+
const getCurrentScope: (typeof import("vue"))["getCurrentScope"];
25+
const h: (typeof import("vue"))["h"];
26+
const inject: (typeof import("vue"))["inject"];
27+
const isProxy: (typeof import("vue"))["isProxy"];
28+
const isReactive: (typeof import("vue"))["isReactive"];
29+
const isReadonly: (typeof import("vue"))["isReadonly"];
30+
const isRef: (typeof import("vue"))["isRef"];
31+
const mapActions: (typeof import("pinia"))["mapActions"];
32+
const mapGetters: (typeof import("pinia"))["mapGetters"];
33+
const mapState: (typeof import("pinia"))["mapState"];
34+
const mapStores: (typeof import("pinia"))["mapStores"];
35+
const mapWritableState: (typeof import("pinia"))["mapWritableState"];
36+
const markRaw: (typeof import("vue"))["markRaw"];
37+
const nextTick: (typeof import("vue"))["nextTick"];
38+
const onActivated: (typeof import("vue"))["onActivated"];
39+
const onBeforeMount: (typeof import("vue"))["onBeforeMount"];
40+
const onBeforeRouteLeave: (typeof import("vue-router"))["onBeforeRouteLeave"];
41+
const onBeforeRouteUpdate: (typeof import("vue-router"))["onBeforeRouteUpdate"];
42+
const onBeforeUnmount: (typeof import("vue"))["onBeforeUnmount"];
43+
const onBeforeUpdate: (typeof import("vue"))["onBeforeUpdate"];
44+
const onDeactivated: (typeof import("vue"))["onDeactivated"];
45+
const onErrorCaptured: (typeof import("vue"))["onErrorCaptured"];
46+
const onMounted: (typeof import("vue"))["onMounted"];
47+
const onRenderTracked: (typeof import("vue"))["onRenderTracked"];
48+
const onRenderTriggered: (typeof import("vue"))["onRenderTriggered"];
49+
const onScopeDispose: (typeof import("vue"))["onScopeDispose"];
50+
const onServerPrefetch: (typeof import("vue"))["onServerPrefetch"];
51+
const onUnmounted: (typeof import("vue"))["onUnmounted"];
52+
const onUpdated: (typeof import("vue"))["onUpdated"];
53+
const onWatcherCleanup: (typeof import("vue"))["onWatcherCleanup"];
54+
const provide: (typeof import("vue"))["provide"];
55+
const reactive: (typeof import("vue"))["reactive"];
56+
const readonly: (typeof import("vue"))["readonly"];
57+
const ref: (typeof import("vue"))["ref"];
58+
const resolveComponent: (typeof import("vue"))["resolveComponent"];
59+
const setActivePinia: (typeof import("pinia"))["setActivePinia"];
60+
const setMapStoreSuffix: (typeof import("pinia"))["setMapStoreSuffix"];
61+
const shallowReactive: (typeof import("vue"))["shallowReactive"];
62+
const shallowReadonly: (typeof import("vue"))["shallowReadonly"];
63+
const shallowRef: (typeof import("vue"))["shallowRef"];
64+
const storeToRefs: (typeof import("pinia"))["storeToRefs"];
65+
const toRaw: (typeof import("vue"))["toRaw"];
66+
const toRef: (typeof import("vue"))["toRef"];
67+
const toRefs: (typeof import("vue"))["toRefs"];
68+
const toValue: (typeof import("vue"))["toValue"];
69+
const triggerRef: (typeof import("vue"))["triggerRef"];
70+
const unref: (typeof import("vue"))["unref"];
71+
const useAttrs: (typeof import("vue"))["useAttrs"];
72+
const useCssModule: (typeof import("vue"))["useCssModule"];
73+
const useCssVars: (typeof import("vue"))["useCssVars"];
74+
const useId: (typeof import("vue"))["useId"];
75+
const useLink: (typeof import("vue-router"))["useLink"];
76+
const useModel: (typeof import("vue"))["useModel"];
77+
const useRoute: (typeof import("vue-router"))["useRoute"];
78+
const useRouter: (typeof import("vue-router"))["useRouter"];
79+
const useSlots: (typeof import("vue"))["useSlots"];
80+
const useTemplateRef: (typeof import("vue"))["useTemplateRef"];
81+
const watch: (typeof import("vue"))["watch"];
82+
const watchEffect: (typeof import("vue"))["watchEffect"];
83+
const watchPostEffect: (typeof import("vue"))["watchPostEffect"];
84+
const watchSyncEffect: (typeof import("vue"))["watchSyncEffect"];
8285
}
8386
// for type re-export
8487
declare global {
8588
// @ts-ignore
86-
export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
87-
import('vue')
89+
export type {
90+
Component,
91+
ComponentPublicInstance,
92+
ComputedRef,
93+
DirectiveBinding,
94+
ExtractDefaultPropTypes,
95+
ExtractPropTypes,
96+
ExtractPublicPropTypes,
97+
InjectionKey,
98+
PropType,
99+
Ref,
100+
MaybeRef,
101+
MaybeRefOrGetter,
102+
VNode,
103+
WritableComputedRef,
104+
} from "vue";
105+
import("vue");
88106
}

0 commit comments

Comments
 (0)