Skip to main content

Honegumi RAG Assistant

An agentic workflow for Bayesian optimization code generation, built with LangGraph and powered by OpenAI models. Honegumi RAG Assistant codifies the end-to-end pipeline—parameter extraction, skeleton code generation, documentation retrieval, and code synthesis—into reusable nodes orchestrated as a LangGraph. LangSmith integration tracks and visualizes your graph executions. The result? Complete, ready-to-run Bayesian optimization code generated in seconds from natural language descriptions.


🚀 Why Honegumi RAG Assistant?

  • Agentic LangGraph design lets you describe problems in natural language and get production-ready code
  • Fast iteration: eliminate manual coding and focus on science
  • Built on Honegumi: Leverages deterministic skeleton generation from Honegumi
  • Intelligent RAG: Retrieves relevant Ax Platform documentation to enhance code generation
  • LangSmith-backed for graph tracking, versioning, and observability
  • Production-ready: versionable, testable, pip-installable

🛠️ Prerequisites


📘 Google Colab Tutorial

To help you get started quickly, we've prepared an interactive Google Colab tutorial:

Google Colab Tutorial: Getting Started with Honegumi RAG Assistant

In this tutorial, you'll learn how to:

  • Install Honegumi RAG Assistant and all necessary dependencies on Colab
  • Set up API keys using Colab Secrets
  • Build a vector store from Ax Platform documentation
  • Describe your optimization problem and generate code
  • View the generated code in your Google Drive

The tutorial runs entirely in Colab—no local setup required. All you need is access to your Google Drive and valid OpenAI/LangSmith API keys.


Installation via pip

  1. Create & activate a conda environment

    conda create -n honegumi_rag python=3.11 -y
    conda activate honegumi_rag
    
  2. Install via pip

    pip install honegumi-rag-assistant
    
  3. Configure your API keys

    Honegumi RAG Assistant will automatically look for a file named .env in your current working directory (or any parent) and load any keys it finds.

    In the folder where you'll run the CLI (or in any ancestor), create a file called .env containing:

    OPENAI_API_KEY=sk-...
    LANGCHAIN_API_KEY=lsv2_...
    
  4. Build vector store (one-time setup)

    For best results with documentation retrieval, build the vector store:

    # Download the build script
    wget https://raw.githubusercontent.com/hasan-sayeed/honegumi_rag_assistant/main/scripts/build_vector_store.py
    
    # Run it
    python build_vector_store.py --output ./ax_docs_vectorstore
    
    # Set the path in your .env
    echo "AX_DOCS_VECTORSTORE_PATH=./ax_docs_vectorstore" >> .env
    
  5. Run the assistant

    Now, start the honegumi-rag pipeline:

    honegumi-rag
    

    Honegumi RAG Assistant will:

    • Prompt you to describe your Bayesian optimization problem
    • Extract parameters (objectives, constraints, search space, etc.)
    • Generate a deterministic code skeleton using Honegumi
    • Retrieve relevant Ax Platform documentation
    • Generate complete, runnable Python code
    • Stream the code generation in real-time
    • Optionally save the generated code to a file

Usage Examples

Interactive Mode (Default)

honegumi-rag

You'll be prompted:

Please describe your Bayesian optimization problem.
(Press Enter when finished)

Your problem:

The assistant generates complete code and displays it in real-time.

Save Generated Code

honegumi-rag --output-dir ./my_experiments

Use Different Models

Customize which GPT models are used for each agent:

honegumi-rag \
  --code-writer-model gpt-5 \
  --param-selector-model gpt-4o \
  --retrieval-planner-model gpt-4o

Key Features

Multi-Agent Architecture

  • Parameter Selector: Extracts optimization parameters from natural language
  • Skeleton Generator: Uses Honegumi for deterministic code templates
  • Retrieval Planner: Generates intelligent documentation queries
  • Parallel Retrievers: Concurrent documentation retrieval for speed
  • Code Writer: GPT-5 powered code generation with streaming
  • Reviewer (optional): Quality assessment and refinement

Advanced Features

  • LangSmith Integration: Full tracing and debugging support
  • Streaming Output: See code generation in real-time
  • Flexible Models: Mix GPT-5 and GPT-4o for cost-performance optimization
  • Optional Save: Print code or save to file—your choice

Command Line Arguments

Argument Description Default
--output-dir Save generated script to specified directory (if omitted, code is only printed, not saved) None (no save)
--debug Enable debug mode with detailed logging False
--review Enable Reviewer agent (slower, more accurate) False
--param-selector-model Model for Parameter Selector gpt-5
--retrieval-planner-model Model for Retrieval Planner gpt-5
--code-writer-model Model for Code Writer agent gpt-5
--reviewer-model Model for Reviewer agent gpt-4o

Example Problems

Chemical Process Optimization

Optimize temperature (100-300°C), pressure (1-5 bar), and catalyst concentration (0.1-1.0 M) 
to maximize conversion rate in a catalytic reaction.

Materials Design

Optimize composition of a polymer blend: Component A (0-100%), Component B (0-100%), 
and curing temperature (80-150°C) to maximize tensile strength while minimizing cost.

Machine Learning Hyperparameters

Optimize neural network hyperparameters: learning rate (1e-5 to 1e-1), 
batch size (16 to 256), and dropout rate (0.1 to 0.5) to maximize validation accuracy.

Documentation & Support


Feedback & Feature Requests

This project demonstrates a proof of concept of what's possible with agentic systems for Bayesian optimization. While Honegumi RAG Assistant works out-of-the-box for many scenarios, your use case may involve more complex pipelines, custom constraints, or specific modeling needs.

Have something bigger in mind? Want Honegumi RAG Assistant to handle advanced features or integrate with your workflow?

We'd love to hear from you!


License

MIT License - see LICENSE.txt for details.


Acknowledgments

Metadata

Release files for honegumi-rag-assistant 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for honegumi-rag-assistant 0.1.7
File Size Uploaded
honegumi_rag_assistant-0.1.7.tar.gz 685.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for honegumi-rag-assistant 0.1.7
File Interpreter ABI Platform
honegumi_rag_assistant-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 732.0 kB

Release files / honegumi_rag_assistant-0.1.7.tar.gz

Download URL honegumi_rag_assistant-0.1.7.tar.gz
Size 685.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d47b306a11ea6a2d5b479b61fb95dc7930b662f0cd9a3204c4f030e12d81a944
BLAKE2b-256 checksum
How to use checksums
28a142c0d9414b5e62932613156d31420f312e8e62ac12b486692a57c518055a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.13

Release files / honegumi_rag_assistant-0.1.7-py3-none-any.whl

Download URL honegumi_rag_assistant-0.1.7-py3-none-any.whl
Size 46.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7697c27499c2056694c7f8fd7b2dd447cbe81a05960b97d7fa04bbc9346d722e
BLAKE2b-256 checksum
How to use checksums
fc4feb3338876936c52b31be51078732e849be1d9ba2ebf61dee3d2256e88865
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.13

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page