O-Reasonable đź§
A lightweight reasoning agent designed to mimic logical planning and problem-solving capabilities using cost-effective OpenAI models. It generates step-by-step plans, executes them sequentially, and synthesizes a final answer.
Features
- 🎯 Dynamic model selection with sensible defaults
- đź“‹ Structured step-by-step planning
- 🔄 Sequential execution of reasoning steps
- 🎨 Clean and informative console output
- ⚡ Built with TypeScript and Vite
Installation
npm install o-reasonable
Configuration
You'll need to set up your OpenAI API key as an environment variable:
export OPENAI_API_KEY=your-api-key-here
Or create a .env file in your project root:
OPENAI_API_KEY=your-api-key-here
Usage
import { runAgent } from 'o-reasonable';
await runAgent("What would be the impact of implementing a four-day work week?");
await runAgent("Analyze the pros and cons of remote work", {
model: "gpt-4o-mini"
});
Configuration Options
The runAgent function accepts a configuration object with the following options:
interface OReasonableConfig {
model?: string;
apiKey?: string;
}
Development
To set up the development environment:
git clone https://github.com/chihebnabil/o-reasonable.git
cd o-reasonable
npm install
npm run dev
Building
npm run build
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT
Credits
Created with ❤️ by Chiheb Nabil