Skip to content

pheonix-coder/cogni-flow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

cogni-flow

⭐ About

  • Open-source web app for asking questions.
  • Built with Next.js, CopilotKit.
  • Uses a ReWoo LangGraph agent to interact with user.
  • Minimal clone of discord ui for webapp

What is ReWOO?

ReWOO is an agent architecture designed to improve efficiency and simplify fine-tuning for tool use in AI systems. It features three main modules:

image

🧠 Planner

  • Generates a step-by-step plan in the following format:
    Plan: <reasoning>
    #E1 = Tool[argument for tool]
    Plan: <reasoning>
    #E2 = Tool[argument for tool with #E1 variable substitution]
    ...
    
  • Leverages variable substitution to avoid redundant calls to the Planner LLM.

Worker

  • Executes the tools using the arguments provided by the Planner.

🧠 Solver

  • Generates the final answer for the original task using the observations from the Worker.

Modules marked with a 🧠 emoji involve an LLM call. By consolidating tool usage planning, ReWOO reduces token consumption and execution time compared to ReACT-style architectures.

🎥 Demo

YouTube

🛠️ Tech Stack

Next.js CopilotKit Tailwind CSS ShadCN UI LangGraph FastAPI

📤 Set up

Setting Up the Agent and UI

1. Get an GITHUB PAT
2. Clone the Repository
  • Clone the repository to your local machine:
    git clone https://github.com/pheonix-coder/cogni-flow.git
3. Set Up the Agent
  • Navigate to the agent directory:
    cd agent
  • Install dependencies using Poetry:
    poetry install
  • Create a .env file inside the ./agent directory with your GITHUB_PAT and TAVILY_API_KEY:
    OPENAI_API_KEY=YOUR_GITHUB_PAT_HERE
    TAVILY_API_KEY=YOUR_TAVILY_API_KEY
    
  • Run the agent demo:
    poetry run demo
4. Set Up the UI
  • Navigate to the UI directory:
    cd ./ui
  • Install dependencies using pnpm:
    pnpm i
  • Create a .env file inside the ./ui directory with your GITHUB_PAT:
    OPENAI_API_KEY=YOUR_GITHUB_PAT_HERE
    
  • Run the Next.js project:
    pnpm dev

Troubleshooting

  1. Ensure no other local application is running on port 8000.
  2. In the file /agent/rag_agent/demo.py, change the address from 0.0.0.0 to 127.0.0.1 or localhost if needed.