Skip to content
bundlabPublic

About

A TypeScript-based personal AI agent with OpenAI GPT-4 integration. Implements an iterative reasoning loop to handle complex, multi-step tasks through an extensible tool system for autonomous problem-solving.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Personal AI Agent

A modern personal AI agent built with TypeScript that can assist with various tasks using LLM capabilities.

Features

  • 🤖 Multi-tool Support: Integrates with multiple AI models and tools
  • 🔄 Reasoning Loop: Iterative reasoning and task execution
  • 📝 Task Management: Handle complex multi-step tasks
  • 🛠️ Tool Integration: Extensible tool system for custom capabilities
  • 📊 Logging & Monitoring: Built-in logging and error handling

Installation

npm install

Setup

  1. Create a .env file from .env.example:

    cp .env.example .env
  2. Add your OpenAI API key:

    OPENAI_API_KEY=sk-...
    

Usage

Development

npm run dev

Build

npm run build

Start

npm start

Project Structure

├── src/
│   ├── index.ts                 # Main entry point
│   ├── agent/
│   │   ├── Agent.ts             # Core agent class
│   │   └── Tool.ts              # Tool interface
│   ├── tools/
│   │   ├── WebSearchTool.ts      # Web search capability
│   │   ├── CalculatorTool.ts     # Math calculations
│   │   └── index.ts              # Tool exports
│   ├── models/
│   │   ├── Message.ts            # Message types
│   │   └── AgentState.ts         # Agent state types
│   ├── utils/
│   │   ├── logger.ts             # Logging utility
│   │   └── config.ts             # Configuration
│   └── services/
│       └── OpenAIService.ts      # OpenAI integration
├── dist/                          # Compiled output
├── package.json
├── tsconfig.json
└── README.md

Architecture

The agent follows a reasoning loop pattern:

  1. Observation: Analyze the current state and available tools
  2. Thought: Reason about the best action
  3. Action: Execute the selected tool
  4. Result: Integrate the result and continue

Configuration

Environment variables:

  • OPENAI_API_KEY: Your OpenAI API key
  • AGENT_NAME: Custom agent name
  • MAX_ITERATIONS: Maximum reasoning loop iterations
  • LOG_LEVEL: Logging level (debug, info, warn, error)

Contributing

Contributions are welcome! Please feel free to submit pull requests.

License

MIT

About

A TypeScript-based personal AI agent with OpenAI GPT-4 integration. Implements an iterative reasoning loop to handle complex, multi-step tasks through an extensible tool system for autonomous problem-solving.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages