Skip to content

Commit 7d04b13

Browse files
authored
Fully-featured Agent Recipe (#53)
*add full feature agent workbook + test fixes
1 parent 35b8fd5 commit 7d04b13

File tree

9 files changed

+1660
-132
lines changed

9 files changed

+1660
-132
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
push:
88
branches:
99
- main
10+
schedule:
11+
- cron: '0 0 * * 1' # Runs every Monday
1012

1113
jobs:
1214
test:

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ An estimated 31% of LLM queries are potentially redundant ([source](https://arxi
8585
| --- | --- |
8686
[/agents/00_langgraph_redis_agentic_rag.ipynb](python-recipes/agents/00_langgraph_redis_agentic_rag.ipynb) | Notebook to get started with lang-graph and agents |
8787
[/agents/01_crewai_langgraph_redis.ipynb](python-recipes/agents/01_crewai_langgraph_redis.ipynb) | Notebook to get started with lang-graph and agents |
88+
[/agents/02_full_featured_agent.ipynb](python-recipes/agents/02_full_featured_agent.ipynb) | Notebook builds full tool calling agent with semantic cache and router |
8889

8990
### Computer Vision
9091
| Recipe | Description |

assets/cache_diagram.png

140 KB
Loading

assets/full_featured_agent.png

136 KB
Loading

assets/router_diagram.png

199 KB
Loading

propositions.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

python-recipes/RAG/04_advanced_redisvl.ipynb

Lines changed: 628 additions & 122 deletions
Large diffs are not rendered by default.

python-recipes/RAG/06_ragas_evaluation.ipynb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,22 +105,22 @@
105105
"outputs": [],
106106
"source": [
107107
"from langchain.text_splitter import RecursiveCharacterTextSplitter\n",
108-
"from langchain.document_loaders import UnstructuredFileLoader\n",
108+
"from langchain_community.document_loaders import PyPDFLoader\n",
109109
"\n",
110110
"CHUNK_SIZE = 2500\n",
111111
"CHUNK_OVERLAP = 0\n",
112112
"\n",
113-
"source_doc = \"resources/nke-10k-2023.pdf\"\n",
113+
"# pdf to load\n",
114+
"path = 'resources/nke-10k-2023.pdf'\n",
115+
"assert os.path.exists(path), f\"File not found: {path}\"\n",
114116
"\n",
115-
"loader = UnstructuredFileLoader(\n",
116-
" source_doc, mode=\"single\", strategy=\"fast\"\n",
117-
")\n",
118-
"\n",
119-
"text_splitter = RecursiveCharacterTextSplitter(\n",
120-
" chunk_size=CHUNK_SIZE, chunk_overlap=CHUNK_OVERLAP\n",
121-
")\n",
117+
"# load and split\n",
118+
"loader = PyPDFLoader(path)\n",
119+
"pages = loader.load()\n",
120+
"text_splitter = RecursiveCharacterTextSplitter(chunk_size=CHUNK_SIZE, chunk_overlap=CHUNK_OVERLAP)\n",
121+
"chunks = text_splitter.split_documents(pages)\n",
122122
"\n",
123-
"chunks = loader.load_and_split(text_splitter)"
123+
"print(\"Done preprocessing. Created\", len(chunks), \"chunks of the original pdf\", path)"
124124
]
125125
},
126126
{

0 commit comments

Comments
 (0)