Skip to content

Commit 83fb576

Browse files
Merge pull request #123 from jasperan/feature/agent-memory-presentation
docs/sync: agent memory deck, multicloud notebooks reorg, picooraclaw + agent-reasoning sync
2 parents 7b9b88a + 950a0a9 commit 83fb576

186 files changed

Lines changed: 29211 additions & 850 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Jupyter notebooks and interactive tutorials covering:
3939
| agent_reasoning_demo | Interactive demo of 11 cognitive architectures (CoT, ToT, ReAct, Self-Reflection, and more) for agent reasoning | Ollama, agent-reasoning | [![Open Notebook](https://img.shields.io/badge/Open%20Notebook-orange?style=flat-square)](./notebooks/agent_reasoning_demo.ipynb) |
4040
| oracle_agentic_rag_hybrid_search | Agentic RAG with vector, keyword, and hybrid search in a single SQL query using LangGraph ReAct agent | Oracle AI Database, langchain-oracledb, LangGraph, OpenAI | [![Open Notebook](https://img.shields.io/badge/Open%20Notebook-orange?style=flat-square)](./notebooks/oracle_agentic_rag_hybrid_search.ipynb) |
4141
| f1_miami_strategy_oracle_26ai | F1 Miami GP strategy intelligence for 2026 — SQL, hybrid vector+keyword search, JSON documents, and property graph in one Oracle 26ai database using real FastF1 data | Oracle AI Database, FastF1, sentence-transformers, Plotly | [![Open Notebook](https://img.shields.io/badge/Open%20Notebook-orange?style=flat-square)](./notebooks/f1_miami_strategy_oracle_26ai.ipynb) |
42+
| multicloud/ | AWS, Azure, Google Cloud, and MongoDB API samples running Oracle AI Database outside OCI | Oracle AI Database + AWS / Azure / Google / MongoDB | [![Browse Folder](https://img.shields.io/badge/Browse%20Folder-orange?style=flat-square)](./notebooks/multicloud) |
4243

4344
### 📚 **Guides** (`/guides`)
4445

@@ -48,6 +49,7 @@ Comprehensive documentation, reference materials, and conference presentations c
4849
| ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
4950
| Building the Brain and Backbone of Enterprise AI Agents | Advanced reasoning and infrastructure strategies for enterprise AI agents. Covers the 2026 agent stack (layered architecture), reasoning patterns (Chain of Thought, Tree of Thoughts, Self-Reflection, Least-to-Most, Decomposed Prompting), and context/belief updates. Presented at DevWeek SF 2026 by Nacho Martinez. | [![View Guide](https://img.shields.io/badge/View%20Guide-green?style=flat-square)](./guides/brain_backbone_enterprise_agents_devweek_sf_2026.pdf) |
5051
| Memory Engineering: The Discipline Behind Memory Augmented Agents | Deep dive into memory engineering as a discipline for AI agents — the science of helping agents remember, reason, and act. Covers the memory ecosystem, form factors, and key disciplines shaping memory-augmented agents. Presented at DevWeek SF 2026 (Keynote) by Richmond Alake. | [![View Guide](https://img.shields.io/badge/View%20Guide-green?style=flat-square)](./guides/memory_engineering_devweek_sf_2026.pdf) |
52+
| Agent Memory with Oracle AI Database | Agent memory architectures and Oracle AI Database as the memory core for AI agents. Presented at the AI Developer Conference hosted by DeepLearning.AI in April 2026 by Eli Schilling. | [![View Guide](https://img.shields.io/badge/View%20Guide-green?style=flat-square)](./guides/dlai_aidev_agent_memory.pptx) |
5153

5254
### 🧠 **Agent Memory** (`/notebooks/agent_memory`)
5355

apps/agent-reasoning/.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ simulation_demo.py
220220
# Dogfood / QA output
221221
dogfood-output/
222222
.playwright-mcp/
223+
content/
223224

224225

225226
# OpenCode-generated documentation (local reference only)
@@ -239,3 +240,10 @@ docs/*.md
239240
task_plan.md
240241
findings.md
241242
progress.md
243+
244+
# Local agent directories
245+
.agents/
246+
.claude/
247+
.crush/
248+
.openhands/
249+
.pi/

apps/agent-reasoning/.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ repos:
3131
rev: v1.5.0
3232
hooks:
3333
- id: detect-secrets
34-
exclude: '(pnpm-lock\.yaml|package-lock\.json|yarn\.lock|go\.sum|poetry\.lock|Cargo\.lock)$'
34+
exclude: '(benchmarks/results/|data/sessions/|datalake/|pnpm-lock\.yaml$|package-lock\.json$|yarn\.lock$|go\.sum$|poetry\.lock$|Cargo\.lock$)'
3535

3636
# ── Block .env files (added by install-pre-commit-hooks.sh) ──────────
3737
- repo: local

apps/agent-reasoning/README.md

Lines changed: 40 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,48 @@
1-
# Agent Reasoning: The Thinking Layer
1+
<p align="center">
2+
<img src="assets/tui-splash.png" alt="Agent Reasoning TUI Splash" width="600"/>
3+
</p>
24

3-
[![PyPI](https://img.shields.io/pypi/v/agent-reasoning?style=for-the-badge)](https://pypi.org/project/agent-reasoning/)
4-
[![PyPI Downloads](https://img.shields.io/pypi/dm/agent-reasoning?style=for-the-badge)](https://pypi.org/project/agent-reasoning/)
5-
[![License](https://img.shields.io/badge/license-MIT-green?style=for-the-badge)](LICENSE)
6-
[![Python](https://img.shields.io/badge/python-3.10%2B-blue?style=for-the-badge)](https://www.python.org/)
7-
![Ollama](https://img.shields.io/badge/backend-Ollama-black?style=for-the-badge)
8-
![Reasoning](https://img.shields.io/badge/reasoning-16%20strategies%20|%20CoT%20|%20ToT%20|%20ReAct%20|%20MCTS%20|%20Debate%20|%20Socratic%20|%20Meta-purple?style=for-the-badge)
9-
![Status](https://img.shields.io/badge/status-experimental-orange?style=for-the-badge)
5+
<h1 align="center">Agent Reasoning: The Thinking Layer</h1>
106

11-
![Agent Reasoning TUI Splash](assets/tui-splash.png)
7+
<p align="center"><strong>Transform standard open-source LLMs into reliable problem solvers with 16 advanced cognitive architectures. From predicting the next token to predicting the next thought.</strong></p>
128

13-
<div align="center">
14-
15-
**[View Interactive Presentation](docs/slides/presentation.html)** | Animated overview of the project
9+
<p align="center">
10+
<img src="https://img.shields.io/badge/Python-3.10+-blue?style=for-the-badge&logo=python&logoColor=white" alt="Python"/>
11+
<img src="https://img.shields.io/badge/Backend-Ollama-black?style=for-the-badge&logo=ollama&logoColor=white" alt="Ollama"/>
12+
<img src="https://img.shields.io/badge/Reasoning-16%20Strategies-purple?style=for-the-badge" alt="Reasoning"/>
13+
<a href="https://pypi.org/project/agent-reasoning/"><img src="https://img.shields.io/pypi/v/agent-reasoning?style=for-the-badge" alt="PyPI"/></a>
14+
<a href="https://pypi.org/project/agent-reasoning/"><img src="https://img.shields.io/pypi/dm/agent-reasoning?style=for-the-badge" alt="PyPI Downloads"/></a>
15+
<img src="https://img.shields.io/badge/License-MIT-green?style=for-the-badge" alt="License"/>
16+
<img src="https://img.shields.io/badge/Status-Experimental-orange?style=for-the-badge" alt="Status"/>
17+
</p>
1618

17-
</div>
19+
---
1820

1921
<table>
20-
<tr>
21-
<td><img src="docs/slides/slide-01.png" alt="Title" width="400"/></td>
22-
<td><img src="docs/slides/slide-02.png" alt="Overview" width="400"/></td>
23-
</tr>
24-
<tr>
25-
<td><img src="docs/slides/slide-03.png" alt="Architecture" width="400"/></td>
26-
<td><img src="docs/slides/slide-04.png" alt="Features" width="400"/></td>
27-
</tr>
28-
<tr>
29-
<td><img src="docs/slides/slide-05.png" alt="Tech Stack" width="400"/></td>
30-
<td><img src="docs/slides/slide-06.png" alt="Getting Started" width="400"/></td>
31-
</tr>
22+
<tr>
23+
<td align="center"><strong>Title</strong><br><img src="docs/slides/slide-01.png" alt="Title" width="400"/></td>
24+
<td align="center"><strong>Overview</strong><br><img src="docs/slides/slide-02.png" alt="Overview" width="400"/></td>
25+
</tr>
26+
<tr>
27+
<td align="center"><strong>Architecture</strong><br><img src="docs/slides/slide-03.png" alt="Architecture" width="400"/></td>
28+
<td align="center"><strong>Features</strong><br><img src="docs/slides/slide-04.png" alt="Features" width="400"/></td>
29+
</tr>
30+
<tr>
31+
<td align="center"><strong>Tech Stack</strong><br><img src="docs/slides/slide-05.png" alt="Tech Stack" width="400"/></td>
32+
<td align="center"><strong>Getting Started</strong><br><img src="docs/slides/slide-06.png" alt="Getting Started" width="400"/></td>
33+
</tr>
3234
</table>
3335

36+
<p align="center">
37+
<a href="https://jasperan.github.io/agent-reasoning/interactive/">Explore the Interactive Explorer &rarr;</a>
38+
&nbsp;&nbsp;|&nbsp;&nbsp;
39+
<a href="docs/slides/presentation.html">View Interactive Presentation &rarr;</a>
40+
</p>
41+
3442
## Installation
3543

3644
<!-- one-command-install -->
37-
> **One-command install**clone, configure, and run in a single step:
45+
> **One-command install**: clone, configure, and run in a single step.
3846
>
3947
> ```bash
4048
> curl -fsSL https://raw.githubusercontent.com/jasperan/agent-reasoning/main/install.sh | bash
@@ -60,7 +68,7 @@
6068
6169
The **Reasoning Layer** is the cognitive engine of the AI stack. While traditional LLMs excel at token generation, they often struggle with complex planning, logical deduction, and self-correction.
6270
63-
This repository transforms standard Open Source models (like `gemma3`, `llama3`) into robust problem solvers by wrapping them in advanced cognitive architectures. It implements findings from key research papers (CoT, ToT, ReAct) to give models "agency" over their thinking process.
71+
This repository transforms standard Open Source models (like `gemma3`, `llama3`) into reliable problem solvers by wrapping them in advanced cognitive architectures. It implements findings from key research papers (CoT, ToT, ReAct) to give models "agency" over their thinking process.
6472
6573
> **"From predicting the next token to predicting the next thought."**
6674
@@ -188,7 +196,7 @@ Interactive Jupyter notebooks demonstrating agent reasoning capabilities:
188196
* **Model Agnostic**: Works with any model served by Ollama.
189197
* **Advanced Architectures**:
190198
* 🔗 **Chain-of-Thought (CoT)** & **Self-Consistency**: Implements Majority Voting ($k$ samples) with temperature sampling.
191-
* 🌳 **Tree of Thoughts (ToT)**: BFS strategy with robust heuristic scoring and pruning.
199+
* 🌳 **Tree of Thoughts (ToT)**: BFS strategy with reliable heuristic scoring and pruning.
192200
* 🛠️ **ReAct (Reason + Act)**: Real-time tool usage (**Web Search** via scraping, Wikipedia API, Calculator) with fallback/mock capabilities. External grounding implemented.
193201
* 🪞 **Self-Reflection**: Dynamic multi-turn Refinement Loop (Draft -> Critique -> Improve).
194202
* 🧩 **Decomposition & Least-to-Most**: Planning and sub-task execution.
@@ -575,7 +583,7 @@ class MyNewAgent(BaseAgent):
575583

576584
* **Model Not Found**: Ensure you have pulled the base model (`ollama pull gemma3:270m`).
577585
* **Timeout / Slow**: ToT and Self-Reflection make multiple calls to the LLM. With larger models (Llama3 70b), this can take time.
578-
* **Hallucinations**: The default demo uses `gemma3:270m` which is extremely small and prone to logic errors. Switch to `gemma2:9b` or `llama3` for robust results.
586+
* **Hallucinations**: The default demo uses `gemma3:270m` which is extremely small and prone to logic errors. Switch to `gemma2:9b` or `llama3` for reliable results.
579587

580588
---
581589

@@ -709,8 +717,7 @@ MIT License - see [LICENSE](LICENSE) for details.
709717
---
710718

711719
<div align="center">
712-
713-
[![GitHub](https://img.shields.io/badge/GitHub-jasperan-181717?style=for-the-badge&logo=github&logoColor=white)](https://github.com/jasperan)&nbsp;
714-
[![LinkedIn](https://img.shields.io/badge/LinkedIn-jasperan-0077B5?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/jasperan/)
715-
720+
<a href="https://github.com/jasperan"><img src="https://img.shields.io/badge/GitHub-jasperan-181717?style=for-the-badge&logo=github" alt="GitHub"/></a>
721+
&nbsp;
722+
<a href="https://linkedin.com/in/jasperan"><img src="https://img.shields.io/badge/LinkedIn-jasperan-0A66C2?style=for-the-badge&logo=linkedin" alt="LinkedIn"/></a>
716723
</div>
Lines changed: 47 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import argparse
2-
import time
32
import json
4-
import sys
53
import random
4+
import sys
5+
import time
66

77
try:
88
import oci
99
except ImportError:
1010
oci = None
1111

12+
1213
def benchmark_embeddings_oci(compartment_id, endpoint, model_id, text_input, dry_run=False):
1314
"""
1415
Benchmarks embedding generation against OCI GenAI Service.
@@ -19,7 +20,7 @@ def benchmark_embeddings_oci(compartment_id, endpoint, model_id, text_input, dry
1920
"input_len": len(text_input),
2021
"latency_ms": 120.0 + random.uniform(0, 20),
2122
"cost_estimate": 0.00001,
22-
"error": None
23+
"error": None,
2324
}
2425

2526
if not oci:
@@ -31,64 +32,75 @@ def benchmark_embeddings_oci(compartment_id, endpoint, model_id, text_input, dry
3132
config=config,
3233
service_endpoint=endpoint,
3334
retry_strategy=oci.retry.NoneRetryStrategy(),
34-
timeout=(10, 240)
35+
timeout=(10, 240),
3536
)
3637

3738
embed_text_details = oci.generative_ai_inference.models.EmbedTextDetails(
3839
compartment_id=compartment_id,
39-
serving_mode=oci.generative_ai_inference.models.OnDemandServingMode(
40-
model_id=model_id
41-
),
40+
serving_mode=oci.generative_ai_inference.models.OnDemandServingMode(model_id=model_id),
4241
inputs=[text_input],
43-
truncate="NONE"
42+
truncate="NONE",
4443
)
4544

4645
start_time = time.time()
47-
response = gen_ai_inference_client.embed_text(embed_text_details)
46+
gen_ai_inference_client.embed_text(embed_text_details)
4847
end_time = time.time()
4948

5049
total_latency = (end_time - start_time) * 1000
51-
50+
5251
# Approximate cost calculation for embeddings
53-
cost_estimate = len(text_input) * 0.0000001
52+
cost_estimate = len(text_input) * 0.0000001
5453

5554
return {
5655
"model": model_id,
5756
"input_len": len(text_input),
5857
"latency_ms": round(total_latency, 2),
5958
"cost_estimate": round(cost_estimate, 7),
60-
"error": None
59+
"error": None,
6160
}
6261

6362
except Exception as e:
64-
return {
65-
"model": model_id,
66-
"input_len": len(text_input),
67-
"error": str(e)
68-
}
63+
return {"model": model_id, "input_len": len(text_input), "error": str(e)}
64+
6965

7066
def main():
7167
parser = argparse.ArgumentParser(description="Benchmark OCI GenAI Embeddings")
7268
parser.add_argument("--compartment-id", type=str, help="OCI Compartment ID")
73-
parser.add_argument("--endpoint", type=str, default="https://inference.generativeai.us-chicago-1.oci.oraclecloud.com", help="OCI GenAI Endpoint")
74-
parser.add_argument("--model-id", type=str, default="cohere.embed-v5.0", help="OCI Embedding Model ID (Embed 4/5)")
75-
parser.add_argument("--input-file", type=str, default=None, help="JSON file containing list of text inputs")
76-
parser.add_argument("--output", type=str, default="oci_embeddings_results.json", help="Output file for results")
69+
parser.add_argument(
70+
"--endpoint",
71+
type=str,
72+
default="https://inference.generativeai.us-chicago-1.oci.oraclecloud.com",
73+
help="OCI GenAI Endpoint",
74+
)
75+
parser.add_argument(
76+
"--model-id",
77+
type=str,
78+
default="cohere.embed-v5.0",
79+
help="OCI Embedding Model ID (Embed 4/5)",
80+
)
81+
parser.add_argument(
82+
"--input-file", type=str, default=None, help="JSON file containing list of text inputs"
83+
)
84+
parser.add_argument(
85+
"--output", type=str, default="oci_embeddings_results.json", help="Output file for results"
86+
)
7787
parser.add_argument("--dry-run", action="store_true", help="Simulate run without calling API")
78-
parser.add_argument("--iterations", type=int, default=10, help="Number of iterations per text input")
79-
88+
parser.add_argument(
89+
"--iterations", type=int, default=10, help="Number of iterations per text input"
90+
)
91+
8092
args = parser.parse_args()
8193

8294
# Default inputs if no file provided
8395
inputs = [
8496
"The quick brown fox jumps over the lazy dog.",
8597
"Artificial intelligence is transforming the world.",
86-
"Detailed benchmarks are crucial for performance analysis."
98+
"Detailed benchmarks are crucial for performance analysis.",
8799
]
88100

89101
if args.input_file:
90102
try:
91-
with open(args.input_file, 'r') as f:
103+
with open(args.input_file, "r") as f:
92104
inputs = json.load(f)
93105
except FileNotFoundError:
94106
print(f"Error: Input file '{args.input_file}' not found.")
@@ -98,21 +110,23 @@ def main():
98110
print(f"Starting embedding benchmark for OCI model: {args.model_id}")
99111
print(f"Iterations per input: {args.iterations}")
100112
print(f"Dry run: {args.dry_run}")
101-
113+
102114
start_global = time.time()
103115
total_requests = len(inputs) * args.iterations
104116
completed = 0
105117

106118
for i in range(args.iterations):
107119
for text in inputs:
108120
completed += 1
109-
print(f"[{completed}/{total_requests}] Iteration {i+1}: input='{text[:30]}...'")
110-
111-
res = benchmark_embeddings_oci(args.compartment_id, args.endpoint, args.model_id, text, args.dry_run)
121+
print(f"[{completed}/{total_requests}] Iteration {i + 1}: input='{text[:30]}...'")
122+
123+
res = benchmark_embeddings_oci(
124+
args.compartment_id, args.endpoint, args.model_id, text, args.dry_run
125+
)
112126
res["iteration"] = i + 1
113127
res["input_sample"] = text[:50]
114128
results.append(res)
115-
129+
116130
if res.get("error"):
117131
print(f" Error: {res['error']}")
118132
else:
@@ -121,10 +135,11 @@ def main():
121135
total_time = time.time() - start_global
122136
print(f"\nBenchmark finished in {total_time:.2f}s")
123137

124-
with open(args.output, 'w') as f:
138+
with open(args.output, "w") as f:
125139
json.dump(results, f, indent=2)
126-
140+
127141
print(f"Results saved to {args.output}")
128142

143+
129144
if __name__ == "__main__":
130145
main()

0 commit comments

Comments
 (0)