Skip to content

iceener/ai

Repository files navigation

Alice AGI

Alice AGI is an application that uses LLM (GPT-4o) to perform actions based on user queries, while using available tools and long-term memory.

⚠️ Important Notice

This is a personal project shared ONLY to demonstrate ideas and concepts. It is not intended to be an open-source assistant for active development or contributions. While discussions and idea exchanges are welcome in the Issues section, please note that this repository is for personal use. Feel free to explore and draw inspiration or create a fork, but active development will remain personal.

Installation

  1. Clone the repository
  2. Install dependencies using bun install
  3. Create .env file based on .env.example and set your own values, especially OPENAI_API_KEY (Anthropic's Claude isn't fully supported yet)
  4. Run the application using bun run dev — but before that, you need to run database migrations and seeds. Also, you need to set up the tools you want to use.

Database, migrations & seeds

Alice AGI uses SQLite as a database with DrizzleORM. To create the database and run migrations, you can use the following commands:

bun generate
bun migrate
bun seed

You can check the database schema in src/database/seed.ts file to see what data is seeded.

Then you can start the application using bun run dev.

Required services

These are the services that are required to be set up before running the application:

  • OpenAI: Set OPENAI_API_KEY in .env file.
  • Anthropic: Set ANTHROPIC_API_KEY in .env file.
  • Langfuse: Set LANGFUSE_API_KEY in .env file.
  • Algolia: Set ALGOLIA_APP_ID, ALGOLIA_API_KEY and ALGOLIA_INDEX_NAME in .env file.
  • Qdrant: Set QDRANT_INDEX, QDRANT_URL and QDRANT_API_KEY in .env file.

Note: You may not be able to run this app with new OpenAI/Anthropic accounts due to rate limits.

Tools Configuration

By default, several tools are already set up in the seed.ts and tools.config.ts files. You can use them as examples and blueprints for creating your own tools or customizing existing ones to suit your needs.

Task Management

As you can see in the seed file, there is a need to set up stages UUIDs and projects UUIDs. After setting env variables, you can get them by accessing /api/tools/linear/states and /api/tools/linear/projects endpoints and pasting them manually into the seed file or directly into the database.

# Linear (linear.app/settings/api)
LINEAR_API_KEY=
LINEAR_TEAM_ID=          
LINEAR_DEFAULT_ASSIGNEE_ID=

Calendar

# Google Calendar - Create OAuth2 app (console.cloud.google.com/apis/credentials)
# Enable Calendar API and configure OAuth consent screen
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=    
GOOGLE_REDIRECT_URI=     # Auth: /api/auth/google

Music

# Spotify - Create OAuth2 app (developer.spotify.com/dashboard)
# Add redirect URI and configure app settings
SPOTIFY_CLIENT_ID=
SPOTIFY_CLIENT_SECRET=   # Auth: /api/spotify/authorize

Communication

# ElevenLabs (elevenlabs.io/settings/keys)
ELEVENLABS_API_KEY=

# Resend (resend.com/api-keys)
RESEND_API_KEY=

Web & Maps

# Firecrawl (firecrawl.dev)
FIRECRAWL_API_KEY=

# Google Maps (console.cloud.google.com/apis/credentials)
GOOGLE_MAPS_API_KEY=

File Storage

# Local file system - no configuration needed
# Files are stored in ./storage directory

Crypto

# CoinGecko API - no key needed for basic usage
# Uses public API endpoints

Additional tools can be added by creating a new tool in the src/services/tools folder and adding it to the src/config/tools.config.ts file. To complete the setup, describe how to use the tool following the pattern of existing tools within the seed file at src/database/seed.ts.

Concept

The idea of Alice AGI aims for simplicity - creating a system that executes tasks based on natural language commands. While not omnipotent, it leverages existing apps, services, and devices the user regularly interacts with. The system performs actions by combining available capabilities with its long-term memory of user preferences and patterns.

Currently, it supports these tools and actions:

  • Memory: supports storing and retrieving information
  • Web (Firecrawl): supports searching the web & loading content from URLs
  • Email (Resend): supports sending emails but only to verified addresses
  • Linear (Linear): supports managing issues
  • Calendar (Google Calendar): supports managing calendar events within a single account
  • Map (Google Maps): supports finding places and directions
  • Spotify (Spotify): supports playing music and controlling playback
  • File: supports reading, writing and uploading files
  • Speech (ElevenLabs): supports text-to-speech
  • Search (Algolia and Qdrant): supports searching through indexed content
  • Crypto: supports checking prices of cryptocurrencies

During the chat, the Large Language Model (LLM) determines which tools to use and how.

Main logic

The main logic has two modes: fast-track and thinking. If the query is classified as a fast-track query, the system will rely solely on LLM's knowledge and skills to answer. Otherwise, it will go through the thinking phase that involves planning tasks and actions.

Interaction

Alice AGI is available at http://localhost:8080. The main endpoint is /api/agi/chat, which is compatible with OpenAI's chat completions API. Personally I use:

  • Alice App for macOS / Windows
  • Siri Shortcuts for iOS (iPhone and Apple Watch)

License

This repo is mainly for my personal use, but feel free to explore the code, get inspired by the concepts, and adapt them for your projects. Just don’t copy the entire project with its original name—I want to avoid any confusion.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published