Adapted from the DeepLearning.AI course: Building AI Applications with Memory
Converted from the original Oracle DB + OpenAI stack to a fully local setup using SQLite + ChromaDB + Ollama.
| Component | Original (Course) | Local (This Repo) |
|---|---|---|
| Structured Storage | Oracle DB | SQLite |
| Vector Store | OracleVS | ChromaDB |
| Embeddings | HuggingFace (sentence-transformers) | Ollama (embeddinggemma:300m) |
| LLM | OpenAI GPT | Ollama (gemma3:4b) / llama3-groq-tool-use:8b for tool calling |
| Web Search | Tavily | Tavily |
| Notebook | Description |
|---|---|
app.ipynb |
Core memory infrastructure — sets up SQLite tables, ChromaDB vector stores, StoreManager, MemoryManager, Toolbox, and registers all tools (Tavily search, arXiv retrieval, paper ingestion, etc.) |
memory_aware_agent.ipynb |
Full memory-aware agent loop — context engineering, automatic summarization, tool execution, and multi-turn conversation with persistent memory |
| Memory Type | Storage | Purpose |
|---|---|---|
| Conversational | SQLite | Chat history per thread |
| Knowledge Base | ChromaDB | Documents, facts, search results |
| Workflow | ChromaDB | Learned tool execution patterns |
| Toolbox | ChromaDB | Tool definitions for semantic discovery |
| Entity | ChromaDB | People, organizations, systems mentioned |
| Summary | ChromaDB | Compressed conversation summaries |
| Tool Log | SQLite | Raw tool inputs/outputs for audit |
-
Install dependencies:
pip install -r requirements.txt
-
Install Ollama models:
ollama pull embeddinggemma:300m ollama pull gemma3:4b ollama pull llama3-groq-tool-use:8b
-
Configure API keys in
.env:TAVILY_API_KEY=tvly-your-key-hereGet a free Tavily key at tavily.com (1,000 searches/month).
-
Run
app.ipynbfirst to build the memory infrastructure and ingest the knowledge base. -
Run
memory_aware_agent.ipynbto use the memory-aware agent.
User Query
↓
1. BUILD CONTEXT — Read from all 7 memory stores
↓
2. CHECK USAGE — Monitor tokens, summarize if >80%
↓
3. SELECT TOOLS — Semantic search for relevant tools
↓
4. EXECUTE — LLM reasoning + tool calls
↓
5. PERSIST — Save conversation, workflow, entities
↓
Final Answer