GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com โ€” GitHub - Harthor/agentvault: Reliable LangChain agents with checkpointing and recovery

BranchesTags
Open more actions menu

Latest commit

 

History

2 Commits
2 Commits

Folders and files

NameName
Last commit message
Last commit date
benchmarks
benchmarks
 
 
core
core
 
 
examples
examples
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
demo_interruption.py
demo_interruption.py
 
 
pyproject.toml
pyproject.toml
 
 

Repository files navigation

AgentVault

Reliable LangChain agents with persistent memory and automatic recovery from failures.

Wraps any LangChain chain with step-level checkpointing, heuristic verification, and automatic retry. Runs fully locally with Ollama โ€” no API keys required.


Why

A 100-step agent pipeline crashes at step 70. Without checkpointing you lose everything and pay to redo it. With AgentVault:

FASE 1 โ€” Interrupted at step 7 of 12

  Vanilla:        ๐Ÿ’ฅ Lost all progress. 7 API calls wasted.
  ReliableAgent:  ๐Ÿ’ฅ 7 checkpoints saved to SQLite.

FASE 2 โ€” Resuming

  Vanilla:        Starts from 0 โ†’ 12 more calls (19 total)
  ReliableAgent:  Resumes from step 8 โ†’ 5 more calls (12 total)

  โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
  โ”‚                       โ”‚   Vanilla   โ”‚   ReliableAgent   โ”‚
  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
  โ”‚ Total API calls       โ”‚     19      โ”‚        12         โ”‚
  โ”‚ Calls saved           โ”‚      โ€”      โ”‚    7  (37% less)  โ”‚
  โ”‚ State after crash     โ”‚  Lost all   โ”‚  7 steps in SQLiteโ”‚
  โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Run the demo: python3 demo_interruption.py

Resilience benchmark โ€” 30 steps with 30% injected failure rate:

Metric Vanilla ReliableAgent
Completion rate 56.7% 96.7%
Failed steps 13 1
Recovery rate โ€” 92%

Stack

  • LangChain โ€” agent/chain abstraction
  • Ollama โ€” local LLM inference (no API keys)
  • OpenViking โ€” persistent context database (auto-detected)
  • SQLite โ€” fallback storage when OpenViking is not available
  • Superpowers โ€” agentic skills framework (inspiration)

Install

pip install -e .

Pull a model:

ollama pull llama3.2
ollama serve

Usage

from langchain_ollama import OllamaLLM
from langchain_core.prompts import PromptTemplate
from langchain_core.output_parsers import StrOutputParser
from core import ReliableAgent

llm = OllamaLLM(model="llama3.2")
chain = PromptTemplate.from_template("Answer: {input}") | llm | StrOutputParser()

agent = ReliableAgent(chain=chain, session_id="my_session", max_retries=2)
result = agent.run_steps([
    {"input": "What is 2+2?"},
    {"input": "Name the planets in the solar system."},
])
print(result)

If the run is interrupted, re-running with the same session_id resumes from the last successful step automatically.


Benchmarks

Resilience benchmark (recommended)

Injects 30% failure rate per step (timeouts, connection resets, empty responses) with a fixed seed:

python -m benchmarks.run_benchmark_flaky

Basic benchmark

30 arithmetic/factual steps, vanilla vs ReliableAgent:

python -m benchmarks.run_benchmark

Example

python examples/simple_agent.py

Project structure

core/
  agent.py      # ReliableAgent โ€” wraps any LangChain chain
  memory.py     # OpenViking + SQLite persistence layer
  verifier.py   # Heuristic step verification (no model calls)
benchmarks/
  run_benchmark.py                  # Basic 30-step benchmark (Ollama)
  run_benchmark_flaky.py            # Resilience benchmark with injected failures
  run_benchmark_portfolio.py        # 20-step financial analysis (Ollama)
  run_benchmark_portfolio_claude.py # Same benchmark with Claude API
examples/
  simple_agent.py   # Minimal working demo
demo_interruption.py  # Crash + recovery demo (shows the core value prop)

How it works

run_steps(steps)
  โ”‚
  โ”œโ”€ Resume from last checkpoint (if any)
  โ”‚
  โ””โ”€ For each step:
       โ”œโ”€ chain.invoke(step_input)
       โ”œโ”€ Verifier.verify(result, history)  โ† no model call
       โ”‚    โ”œโ”€ empty output?  โ†’ retry
       โ”‚    โ”œโ”€ loop detected? โ†’ retry
       โ”‚    โ””โ”€ inconsistent?  โ†’ retry
       โ”œโ”€ Save to memory (OpenViking or SQLite)
       โ””โ”€ If max_retries exceeded โ†’ mark failed, continue

Credits

  • volcengine/OpenViking โ€” context database for AI agents
  • obra/superpowers โ€” agentic skills framework

About

Reliable LangChain agents with checkpointing and recovery

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 โ€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800ร—600. No cookies required.