This is a TypeScript-based AI agent prototype that has memory and can process user messages and execute various tools based on natural language input.
- Node.js (v16 or higher)
- npm or yarn package manager
- OpenAI API key
- Clone the repository:
git clone <repository-url>
cd ai-agent-prototype- Install dependencies:
npm install- Configure environment variables:
Create or modify the
.envfile in the root directory and add your OpenAI API key:
OPENAI_API_KEY=your_api_key_here
index.ts- Main entry point of the applicationsrc/- Source code directory containing agent implementation and toolstypes.ts- TypeScript type definitionsdb.json- Local database file for storing data
To run the AI agent, use the following command:
npm start "<your-message>"Replace <your-message> with the instruction or query you want to send to the agent.
Example:
npm start "What is the current time?"The project uses TypeScript and is configured with ESM modules. Key dependencies include:
openai- For AI model interactionslowdb- Local JSON databasezod- Runtime type checkingdotenv- Environment variable management
To modify or extend the agent's capabilities, explore the src/tools directory where various tools are implemented.
This project is proprietary and confidential. All rights reserved.