Skip to content

farzanmrz/brander-agent-clhack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BranderAgent

AI-powered personal branding agent for Twitter/X. Define your brand "spheres" via free-text descriptions, and the agent generates search queries, discovers relevant web content and news, drafts original tweets grounded in real-time research, and learns from your feedback over time. Built for the Continual Learning Hackathon by Creators Corner (Feb 2026).


Tech Stack

  • Python 3.11 — Core backend logic
  • FastAPI — API framework
  • SQLite — Lightweight persistent storage
  • HTML / CSS / JS — Frontend dashboard
  • Conda — Environment management (hackenv)

Sponsor Tools

  • You.com — Search + Live News APIs for real-time content discovery (~10 results per query)
  • Composio — Twitter OAuth + tweet posting
  • Google Gemini — LLM for query generation + tweet drafting
  • Render — Hosting + deployment

How It Works

  1. Authenticate — User logs in with Twitter/X via Composio OAuth
  2. Define Sphere — User writes free-text description of what they want to post about (e.g., "AI developer sharing practical takes on new tools")
  3. Query Generation — Gemini generates 5 focused search queries from the sphere description
  4. Query Review — User can accept queries as-is or tweak wording before search
  5. Content Discovery — Each query runs through You.com Search + Live News APIs (~10 results per query)
  6. Source Selection — Results displayed grouped by query (title, snippet, URL). User checks which to use as tweet material
  7. Tweet Drafting — Gemini drafts original tweets based on selected sources + sphere context + past feedback
  8. Draft Review — User approves, edits, or rejects each draft
  9. Posting — Approved tweets posted to Twitter/X via Composio
  10. Learning Loop — All feedback (approved/edited/rejected drafts, query tweaks, source selections) stored in SQLite and fed into future Gemini prompts

Run / Deploy

  • Local (one command): python run.py — backend on port 3000 (or set PORT).
  • Docker (backend + frontend): Runs backend on 3000 and Next.js dev server on 3001.
    docker-compose up
    Then open http://localhost:3000 for the app; the API is at http://localhost:3001 (and /api is proxied from the app).
  • Docker (backend only): Build and run the API (and optional pre-built static):
    docker build -t brander-agent . && docker run -p 3000:3000 brander-agent
  • Render: Use the repo’s render.yaml (Blueprint). Build runs pip install, builds the React app into static/, then start runs uvicorn main:app --host 0.0.0.0 --port $PORT. Set env vars (e.g. YOUCOM_API_KEY, COMPOSIO_API_KEY, GOOGLE_API_KEY) in the Render dashboard.

Quick Start

1. Clone & Setup Environment

git clone https://github.com/farzanmrz/brander-agent-clhack.git
cd brander-agent-clhack
conda env create -f environment.yml
conda activate hackenv

2. Set Up API Keys

Create a .env file in the project root:

YOUCOM_API_KEY=your_youcom_api_key
COMPOSIO_API_KEY=your_composio_api_key
GOOGLE_API_KEY=your_google_gemini_api_key
DATABASE_URL=sqlite:///./brander.db

Development Tasks

Phase 1: Setup (Complete ✓)

  • Conda environment created
  • Memory bank initialized

Phase 2: Core Implementation (In Progress)

  • Create .env.example template
  • Initialize FastAPI app structure
  • Define SQLite schema (spheres, queries, sources, drafts, feedback)
  • Implement Twitter OAuth via Composio
  • Implement sphere creation endpoint
  • Implement Gemini query generation (5 queries from description)
  • Implement query review UI
  • Integrate You.com APIs (Search + Live News)
  • Implement source selection UI (checklist grouped by query)
  • Implement Gemini tweet drafting (sources + feedback → tweets)
  • Implement draft review UI (approve/edit/reject)
  • Implement tweet posting via Composio
  • Implement feedback loop storage
  • Deploy to Render

Stretch Goals

  • Reply-to-tweets feature (search for tweets to reply to)

Team

4 developers building this in 5.5 hours (11 AM - 4:30 PM PT, demo at 5 PM).

Dev Focus:

  • End-to-end working demo over UI polish
  • MVP UI: Simple checklists and text inputs
  • No over-engineering — plain Python functions, no agent frameworks

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors