Skip to content

Commit

Permalink
refactor: rename RAG_Agent to LlamaIndexAgent and LangChainAgent and …
Browse files Browse the repository at this point in the history
…add knowledge_bank params
  • Loading branch information
cmgzn committed Nov 19, 2024
1 parent 7909ab8 commit 6a70b63
Show file tree
Hide file tree
Showing 8 changed files with 260 additions and 134 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"class": "RAG_Agent",
"class": "LlamaIndexAgent",
"args": {
"name": "Tutorial-Assistant",
"description": "Tutorial-Assistant is an agent that can provide answer based on English tutorial material, mainly the markdown files. It can answer general questions about AgentScope.",
Expand All @@ -13,7 +13,7 @@
}
},
{
"class": "RAG_Agent",
"class": "LlamaIndexAgent",
"args": {
"name": "Code-Search-Assistant",
"description": "Code-Search-Assistant is an agent that can provide answer based on AgentScope code base. It can answer questions about specific modules in AgentScope.",
Expand All @@ -26,7 +26,7 @@
}
},
{
"class": "RAG_Agent",
"class": "LlamaIndexAgent",
"args": {
"name": "API-Assistant",
"description": "API-Assistant is an agent that can answer questions about APIs in AgentScope. It can answer general questions about AgentScope.",
Expand All @@ -39,7 +39,7 @@
}
},
{
"class": "RAG_Agent",
"class": "LlamaIndexAgent",
"args": {
"name": "Searching-Assistant",
"description": "Search-Assistant is an agent that can provide answer based on AgentScope code and tutorial. It can answer questions about everything in AgentScope codes and tutorials.",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"class": "RAG_Agent",
"class": "LangChainAgent",
"args": {
"name": "Tutorial-Assistant",
"description": "Tutorial-Assistant is an agent that can provide answer based on English tutorial material, mainly the markdown files. It can answer general questions about AgentScope.",
Expand All @@ -13,7 +13,7 @@
}
},
{
"class": "RAG_Agent",
"class": "LangChainAgent",
"args": {
"name": "Code-Search-Assistant",
"description": "Code-Search-Assistant is an agent that can provide answer based on AgentScope code base. It can answer questions about specific modules in AgentScope.",
Expand All @@ -26,7 +26,7 @@
}
},
{
"class": "RAG_Agent",
"class": "LangChainAgent",
"args": {
"name": "API-Assistant",
"description": "API-Assistant is an agent that can answer questions about APIs in AgentScope. It can answer general questions about AgentScope.",
Expand All @@ -39,7 +39,7 @@
}
},
{
"class": "RAG_Agent",
"class": "LangChainAgent",
"args": {
"name": "Searching-Assistant",
"description": "Search-Assistant is an agent that can provide answer based on AgentScope code and tutorial. It can answer questions about everything in AgentScope codes and tutorials.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,7 @@
}
}
}
],
"store_and_index":{
"stores":{
"vector_store": {
"create_object": true,
"module": "langchain_elasticsearch",
"class": "ElasticsearchStore",
"init_args": {
"es_url": "http://localhost:9200",
"index_name": "lc_code_rag",
"es_user": "elastic",
"es_password": "147258",
"embedding_key": "embedding"
}
}
}
}
]
},
{
"knowledge_id": "agentscope_api_rag",
Expand Down
10 changes: 10 additions & 0 deletions examples/conversation_with_RAG_agents/rag_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ def main() -> None:
},
)

# # if use langchain knowledge, we need to set backend_engine
# knowledge_bank.add_data_as_knowledge(
# knowledge_id="agentscope_tutorial_rag",
# emb_model_name="qwen_emb_config",
# data_dirs_and_types={
# "../../docs/sphinx_doc/en/source/tutorial": ["*.md"],
# },
# backend_engine="langchain"
# )

# let knowledgebank to equip rag agent with a (set of) knowledge
# corresponding to its knowledge_id_list
for agent in rag_agent_list:
Expand Down
3 changes: 2 additions & 1 deletion src/agentscope/agents/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from .react_agent import ReActAgent
from .rag_agent import (
LlamaIndexAgent,
RAG_Agent,
LangChainAgent,
)


Expand All @@ -20,4 +20,5 @@
"UserAgent",
"ReActAgent",
"LlamaIndexAgent",
"LangChainAgent",
]
Loading

0 comments on commit 6a70b63

Please sign in to comment.