Skip to content

Commit 01db213

Browse files
authored
feat: langgraph short-term memory agent
2 parents 1255c13 + cdf4eb3 commit 01db213

34 files changed

Lines changed: 2040 additions & 16 deletions

File tree

README.md

Lines changed: 39 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,45 @@
11
<div style="text-align: center;">
22

33
![Agentic Starter Kits](/images/ask_logo.png)
4+
45
# Agentic Starter Kits
56

67
</div>
78

89
## Purpose
9-
Production-ready agent templates to build and deploy LLM-powered agents. Run locally (e.g. with Ollama/Llama Stack) or deploy to Red Hat OpenShift. Each agent has step-by-step docs.
10+
11+
Production-ready agent templates to build and deploy LLM-powered agents. Run locally (e.g. with Ollama/Llama Stack) or
12+
deploy to Red Hat OpenShift. Each agent has step-by-step docs.
1013

1114
## Agents
15+
1216
Choose an agent and follow its README for setup and deployment:
1317

14-
- **[LangGraph ReAct](./agents/base/langgraph_react_agent/README.md)** – General-purpose agent using a ReAct loop: it reasons and calls tools (e.g. search, math) step by step. Built with LangGraph and LangChain.
15-
- **[LlamaIndex WebSearch](./agents/base/llamaindex_websearch_agent/README.md)** – Agent built on LlamaIndex that uses a web search tool to query the internet and use the results in its answers.
16-
- **[OpenAI Responses](./agents/base/openai_responses_agent/README.md)** – Minimal agent with no framework: only the OpenAI Python client and an Action/Observation loop with tools. Use with OpenAI or any compatible API.
17-
- **[LangGraph Agentic RAG](./agents/community/langgraph_agentic_rag/README.md)** – RAG agent that indexes documents in a vector store (Milvus) and retrieves relevant chunks to augment the LLM’s answers with your own data.
18+
- **[LangGraph ReAct](./agents/base/langgraph_react_agent/README.md)** – General-purpose agent using a ReAct loop: it
19+
reasons and calls tools (e.g. search, math) step by step. Built with LangGraph and LangChain.
20+
- **[LlamaIndex WebSearch](./agents/base/llamaindex_websearch_agent/README.md)** – Agent built on LlamaIndex that uses a
21+
web search tool to query the internet and use the results in its answers.
22+
- **[OpenAI Responses](./agents/base/openai_responses_agent/README.md)** – Minimal agent with no framework: only the
23+
OpenAI Python client and an Action/Observation loop with tools. Use with OpenAI or any compatible API.
24+
- **[LangGraph Agentic RAG](./agents/community/langgraph_agentic_rag/README.md)** – RAG agent that indexes documents in
25+
a vector store (Milvus) and retrieves relevant chunks to augment the LLM’s answers with your own data.
26+
- **[LangGraph ReAct with Database Memory](./agents/community/langgraph_react_with_database_memory/README.md)** – ReAct
27+
agent with PostgreSQL-backed conversation memory. Full chat history is persisted in the database while a FIFO sliding
28+
window keeps only the last N messages in the LLM context. Built with LangGraph and `create_agent` middleware.
1829

1930
## Deployment Options
31+
2032
Agents in this repository can support two deployment modes:
2133

2234
### 🖥️ Local Development
35+
2336
- Run agents on your local machine
2437
- Use Llama Stack server with Ollama for model serving
2538
- Ideal for development, testing, and experimentation
2639
- No cloud infrastructure required
2740

2841
### ☁️ Production Deployment
42+
2943
- Deploy agents to Red Hat OpenShift Cluster
3044
- Containerized deployment with Kubernetes
3145
- Production-grade scaling and monitoring
@@ -41,7 +55,8 @@ Agentic-Starter-Kits/
4155
│ │ └── llamaindex_websearch_agent/ # LlamaIndex web search agent
4256
│ │ └── openai_responses_agent/ # OpenAI Responses API (no framework)
4357
│ └── community/
44-
│ └── langgraph_agentic_rag/ # RAG agent with Milvus vector store
58+
│ ├── langgraph_agentic_rag/ # RAG agent with Milvus vector store
59+
│ └── langgraph_react_with_database_memory/ # ReAct agent with PostgreSQL memory (FIFO)
4560
├── run_llama_server.yaml # Llama Stack server configuration
4661
├── utils.py # Shared utilities
4762
└── README.md # This file
@@ -50,41 +65,52 @@ Agentic-Starter-Kits/
5065
---
5166

5267
## How to Use This Repository
68+
5369
1. **Start Here**: Read this README to understand the overall structure and install core dependencies
5470
2. **Choose an Agent**: Select an agent from the `agents/` directory based on your use case
5571
3. **Follow Agent README**: Navigate to the agent's directory and follow its specific README for:
56-
- Agent-specific dependencies installation
57-
- Configuration and setup
58-
- Local development or OpenShift deployment
59-
- Usage examples and API endpoints
60-
72+
- Agent-specific dependencies installation
73+
- Configuration and setup
74+
- Local development or OpenShift deployment
75+
- Usage examples and API endpoints
6176

6277
### Pre-requisitions to run that repo
78+
6379
Run this script to set up repo stuff with a use of [UV](https://docs.astral.sh/uv/) and python 3.12
6480

6581
Download repo
82+
6683
```bash
6784
git clone https://github.com/red-hat-data-services/agentic-starter-kits
6885
```
86+
6987
Get into root dir
88+
7089
```bash
7190
cd agentic-starter-kits
7291
```
92+
7393
Install UV
94+
7495
```bash
7596
curl -LsSf https://astral.sh/uv/install.sh | sh
7697
```
98+
7799
---
78100

79101
## Additional Resources
102+
80103
- **Llama Stack Documentation**: https://llama-stack.readthedocs.io/
81104
- **Ollama Documentation**: https://docs.ollama.com/
82105
- **OpenShift Documentation**: https://docs.openshift.com/
83106
- **Kubernetes**: https://kubernetes.io/docs/
84107

85-
86108
## Contributing
109+
87110
Contributions are welcome! Please see individual agent READMEs for specific guidelines.
88111

89112
## License
90-
MIT License
113+
114+
MIT License
115+
116+
Copyright (c) 2026
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
MIT License
2+
3+
Copyright (c) 2026
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
MIT License
2+
3+
Copyright (c) 2026
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
MIT License
2+
3+
Copyright (c) 2026

agents/community/__init__.py

Whitespace-only changes.

agents/community/langgraph_agentic_rag/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024
3+
Copyright (c) 2026
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.env
2+
.vscode
3+
__pycache__
4+
.pytest_cache
5+
.venv
6+
dist
7+
config.toml
8+
inference_engine_cache/
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Use Python 3.12 slim image as base
2+
FROM python:3.12-slim
3+
4+
# Set working directory
5+
WORKDIR /app
6+
7+
# Create a non-privileged user for OpenShift
8+
# UID 1001 is commonly used in OpenShift deployments
9+
RUN groupadd -r appuser && useradd -r -u 1001 -g appuser appuser
10+
11+
# Install uv for fast dependency management
12+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
13+
14+
# Copy project files for dependency installation
15+
COPY pyproject.toml .
16+
COPY src/ ./src/
17+
18+
# Install the project and its dependencies using uv
19+
RUN uv pip install --system --no-cache .
20+
21+
# Copy the application entrypoint
22+
COPY main.py .
23+
24+
# Create data directory for vector store
25+
RUN mkdir -p /app/data && \
26+
chown -R appuser:appuser /app
27+
28+
# Switch to non-privileged user
29+
USER appuser
30+
31+
# Expose port 8080 (OpenShift standard)
32+
EXPOSE 8080
33+
34+
# Set environment variables
35+
ENV PORT=8080
36+
ENV PYTHONPATH=/app:/app/src
37+
38+
# Run the application
39+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080"]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)