Based on repository activity, growth velocity and community engagement.
22
Growth1/30
Activity2/25
Popularity2/25
Trust18/20
3
Stars
High
Sentiment
Votes
3
README.md
Honegumi RAG Assistant: Agentic Code Generation for Bayesian Optimization
Figure: Schematic of the Honegumi RAG Assistant agentic pipeline for generating Bayesian optimization code from natural language.
An intelligent AI assistant that converts natural language problem descriptions into ready-to-run Bayesian optimization code using Meta's Ax Platform
Overview
Honegumi RAG Assistant is an advanced agentic AI system that automatically generates high-quality, executable Python code for Bayesian optimization experiments. Built on top of , it uses and to orchestrate multiple specialized agents that collaborate to understand your optimization problem, retrieve relevant documentation, and generate production-ready code using the .
Honegumi provides deterministic skeleton code generation based on problem parameters, and this RAG Assistant enhances it by retrieving relevant Ax Platform documentation to help the LLM transform the skeleton into complete, domain-specific code tailored to your problem.
Simply describe your optimization problem in plain English, and the assistant produces complete, runnable code tailored to your specific requirements.
Key Capabilities
Natural language to code: Describe optimization problems conversationally
Intelligent RAG: Parallel retrieval of relevant Ax documentation to supplement skeleton code
Built on Honegumi: Leverages Honegumi for deterministic skeleton generation
Multi-agent architecture: Specialized agents for parameter extraction, retrieval planning, and code writing
Flexible model selection: Mix GPT-5 and GPT-4o models for cost-performance optimization
Key Features
Multi-Agent Architecture
Intelligent Parameter Detection: Two-stage extraction process with chain-of-thought reasoning for accurate grid parameter selection
Skeleton Generator: Uses Honegumi to create deterministic code templates
Retrieval Planner: Intelligently generates retrieval queries based on problem complexity
Parallel Retrievers: For efficient documentation retrieval - multiple queries executed concurrently to minimize latency
Code Writer: GPT-5 powered code generation with streaming output
Reviewer (optional): Quality assessment and revision requests (disabled by default for speed)
Advanced Features
LangSmith Integration: Full tracing support for debugging and monitoring
In the project root directory, create a file called .env containing:
# Required: OpenAI API Key for LLM and embeddings
OPENAI_API_KEY=sk-your-actual-openai-api-key-here
# Optional: LangChain for tracing (recommended for debugging)
LANGCHAIN_API_KEY=your-langchain-api-key-here
LANGCHAIN_TRACING_V2=true
LANGCHAIN_PROJECT=Honegumi RAG Assistant
# Optional: Path to FAISS vector store (if using RAG)
AX_DOCS_VECTORSTORE_PATH=data/processed/ax_docs_vectorstore
RETRIEVAL_TOP_K=5
Build Vector Store for RAG:
For best results with documentation retrieval, run:
# Build vector store (one-time setup, defaults to Ax v0.4.3)
python -m honegumi_rag_assistant.build_vector_store
# Or specify a different Ax version
python -m honegumi_rag_assistant.build_vector_store --ax-version 0.4.0
The vector store will be saved to data/processed/ax_docs_vectorstore/ and automatically loaded if present.
honegumi-rag # if you installed via pip
# Or: python -m honegumi_rag_assistant
The assistant will prompt you to describe your Bayesian optimization problem in natural language:
Your problem:
Optimize temperature (50-200Β°C) and pressure (1-10 bar) for maximum yield in a chemical reaction.
After typing your problem description, press Enter. The assistant will process your problem and generate code in real-time (streaming), displaying it as it's created.
By default, code is only printed to the console (not saved). To save the generated script to a file, use --output-dir:
honegumi-rag --output-dir ./my_experiments
Optional: Enable debug mode to see detailed agent decisions:
honegumi-rag --debug
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 |
This project demonstrates a proof of concept of what's possible with agentic systems for Bayesian optimization code generation. While Honegumi RAG Assistant works out-of-the-box for many scenarios, your use case may involve more complex pipelines, custom constraints, multi-objective optimization, or specific modeling needs.
Have something bigger in mind? Want Honegumi RAG Assistant to handle advanced features, integrate with your workflow, or adapt to your domain?