8000 GitHub - ankitmalik84/Code_Infinity_AI
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ankitmalik84/Code_Infinity_AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Infinity AI

A modern, responsive AI chat interface with integrated web search functionality. Code Infinity AI provides a clean UI similar to Perplexity.ai, combining conversational AI with real-time search capabilities

✨ Features

  • Real-time AI Responses - Stream AI responses as they're generated
  • Integrated Web Search - AI can search the web for up-to-date information
  • Conversation Memory - Maintains context throughout your conversation
  • Search Process Transparency - Visual indicators show searching, reading, and writing stages
  • Responsive Design - Clean, modern UI that works across devices

🏗️ Architecture

Code Infinity AI follows a client-server architecture:

Client (Next.js + React)

  • Modern React application built with Next.js
  • Real-time streaming updates using Server-Sent Events (SSE)
  • Components for message display, search status, and input handling

Server (FastAPI + LangGraph)

  • Python backend using FastAPI for API endpoints
  • LangGraph implementation for conversation flow with LLM and tools
  • Integration with Tavily Search API for web searching capabilities
  • Server-Sent Events for real-time streaming of AI responses

🚀 Getting Started

Prerequisites

  • Node.js 18+
  • Python 3.10+
  • OpenAI API key
  • Tavily API key

Installation

  1. Clone the repository

    git clone
    cd code_infinity_ai
  2. Set up the server

    cd server
    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    pip install -r requirements.txt
  3. Configure environment variables
    Create a .env file in the server directory: OPENAI_API_KEY=your_openai_api_key TAVILY_API_KEY=your_tavily_api_key

  4. Set up the client

    cd ../client
    npm install

Docker Setup

  1. Build and run with Docker Compose

    docker-compose up --build

    This will build and start both the client and server containers.

  2. Build containers separately

    For server:

    cd server
    docker build -t code-infinity-server .
    docker run -p 8000:8000 code-infinity-server

    For client:

    cd client
    docker build -t code-infinity-client .
    docker run -p 3000:3000 code-infinity-client
  3. Environment Variables with Docker

    • Create a .env file in the root directory
    • Docker Compose will automatically use these variables
    • For manual container runs, use:
      docker run --env-file .env -p 8000:8000 code-infinity-server

Running the Application

  1. Start the server

    cd server
    uvicorn app:app --reload
    
  2. Start the client

    cd client
    npm run dev
    
  3. Open your browser and navigate to http://localhost:3000

🔍 How It Works

  1. User sends a message through the chat interface
  2. Server processes the message using GPT-4o
  3. AI decides whether to use search or respond directly
  4. If search is needed:
    • Search query is sent to Tavily API
    • Results are processed and provided back to the AI
    • AI uses this information to formulate a response
  5. Response is streamed back to the client in real-time
  6. Search stages are displayed to the user (searching, reading, writing)

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0