{"id":28960415,"url":"https://github.com/potlock/funding-ai","last_synced_at":"2025-06-24T01:13:13.311Z","repository":{"id":298897325,"uuid":"1000694233","full_name":"PotLock/funding-ai","owner":"PotLock","description":"# Agent: Dollar-A-Day Donation Agent (DADA)  ---  A fully autonomous NEAR-powered donation agent that donates $1/day to Potlock campaigns based on user preferences.","archived":false,"fork":false,"pushed_at":"2025-06-19T17:10:38.000Z","size":136,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-19T18:36:46.984Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://funding-ai-tau.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PotLock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-12T07:20:42.000Z","updated_at":"2025-06-19T17:10:41.000Z","dependencies_parsed_at":"2025-06-19T18:37:31.742Z","dependency_job_id":null,"html_url":"https://github.com/PotLock/funding-ai","commit_stats":null,"previous_names":["potlock/dada-agent","potlock/funding-ai"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PotLock/funding-ai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PotLock%2Ffunding-ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PotLock%2Ffunding-ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PotLock%2Ffunding-ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PotLock%2Ffunding-ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PotLock","download_url":"https://codeload.github.com/PotLock/funding-ai/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PotLock%2Ffunding-ai/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261584267,"owners_count":23180679,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-24T01:13:05.708Z","updated_at":"2025-06-24T01:13:13.296Z","avatar_url":"https://github.com/PotLock.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧠 Funding AI - Intelligent Funding Platform\n\nA sophisticated AI-powered funding platform that intelligently matches donors with impactful projects and campaigns on the NEAR blockchain. The platform uses advanced search algorithms, vector similarity, and LLM-based evaluation to provide personalized funding recommendations.\n\n## 🚀 Features\n\n### Core Functionality\n- **🔍 Intelligent Search**: Vector similarity search across projects and campaigns\n- **🤖 AI-Powered Evaluation**: LLM-based relevance scoring and holistic evaluation\n- **📊 Smart Ranking**: Hybrid ranking combining similarity scores and AI evaluation\n- **🎯 Personalized Recommendations**: Weighted allocation based on user preferences\n- **🌐 Multi-Platform Integration**: Support for projects and campaigns from Potlock ecosystem\n\n### Search \u0026 Discovery\n- **Unified Search**: Search across both projects and campaigns simultaneously\n- **Tabbed Interface**: View \"All\", \"Projects\", or \"Campaigns\" separately\n- **Real-time Results**: Live data fetching from NEAR smart contracts\n- **Rich Metadata**: Display images, descriptions, social links, and evaluation scores\n\n### Evaluation System\n- **Relevance Scoring**: AI evaluation of query relevance (0-10 scale)\n- **Impact Assessment**: Evaluation of project/campaign potential impact\n- **Funding Needs Analysis**: Assessment of funding requirements and urgency\n- **Holistic Reports**: Comprehensive evaluation reports for each item\n\n## 🏗️ Technical Architecture\n\n### Frontend Stack\n- **Framework**: Next.js 14 with TypeScript\n- **Styling**: Tailwind CSS with custom design system\n- **State Management**: React hooks with local state\n- **UI Components**: Custom components with responsive design\n- **Icons**: Feather Icons for consistent iconography\n\n### Backend \u0026 AI\n- **Search Engine**: LangChain MemoryVectorStore for vector similarity search\n- **Embeddings**: OpenAI text-embedding-ada-002 for semantic search\n- **LLM Integration**: OpenAI GPT-3.5-turbo for evaluation and ranking\n- **API Routes**: Next.js API routes for search functionality\n\n### Blockchain Integration\n- **NEAR Protocol**: Direct integration with NEAR blockchain\n- **Smart Contracts**: \n  - Potlock Projects Contract (`v1.social08.near`)\n  - Potlock Campaigns Contract (`v1.campaigns.staging.potlock.near`)\n- **Data Fetching**: Real-time data from NEAR RPC endpoints\n- **Profile Enrichment**: Integration with `social.near` for project metadata\n\n### Search Pipeline\n1. **Data Ingestion**: Fetch projects and campaigns from smart contracts\n2. **Vector Embedding**: Convert text content to vector embeddings\n3. **Similarity Search**: Find relevant items using vector similarity\n4. **LLM Reranking**: Use GPT-3.5-turbo to rerank results by relevance\n5. **Holistic Evaluation**: Generate comprehensive evaluation reports\n6. **Scoring**: Assign scores for relevance, impact, and funding needs\n7. **Weighted Allocation**: Calculate allocation percentages based on scores\n\n## 🔧 Implementation Details\n\n### Search Algorithm\n```typescript\n// Hybrid search combining vector similarity and LLM evaluation\nconst searchPipeline = async (query: string) =\u003e {\n  // 1. Vector similarity search\n  const vectorResults = await vectorStore.similaritySearch(query, topK);\n  \n  // 2. LLM reranking\n  const rerankedResults = await rerankWithOpenAI(query, vectorResults);\n  \n  // 3. Holistic evaluation\n  const evaluations = await Promise.all(\n    rerankedResults.map(result =\u003e generateEvaluationReport(query, result))\n  );\n  \n  // 4. Scoring and allocation\n  const scoredResults = await Promise.all(\n    evaluations.map(evaluation =\u003e scoreEvaluationReport(evaluation))\n  );\n  \n  return scoredResults;\n};\n```\n\n### Data Processing\n- **Project Data**: Enriched with profile information from `social.near`\n- **Campaign Data**: Direct from Potlock campaigns contract\n- **Image Handling**: IPFS integration for project logos and images\n- **Social Links**: Automatic URL formatting for various platforms\n\n### URL Formatting\nThe platform automatically formats social media URLs:\n- **Twitter/X**: `https://x.com/{username}`\n- **GitHub**: `https://github.com/{username}`\n- **Telegram**: `https://t.me/{username}`\n- **Discord**: `https://discord.gg/{invite}`\n- **LinkedIn**: `https://www.linkedin.com/in/{profile}`\n- **Website**: `https://{domain}`\n\n## 📁 Project Structure\n\n```\nfunding-ai/\n├── src/\n│   ├── app/\n│   │   ├── api/\n│   │   │   └── search/\n│   │   │       └── route.ts          # Search API endpoint\n│   │   ├── dashboard/\n│   │   │   └── page.tsx              # Dashboard page\n│   │   ├── globals.css               # Global styles\n│   │   ├── layout.tsx                # Root layout\n│   │   └── page.tsx                  # Main search interface\n│   ├── components/\n│   │   ├── Footer.tsx                # Footer component\n│   │   └── Header.tsx                # Header component\n│   └── contexts/\n│       └── WalletSelectorContext.tsx # NEAR wallet integration\n├── package.json                      # Dependencies and scripts\n├── tailwind.config.js               # Tailwind configuration\n└── tsconfig.json                    # TypeScript configuration\n```\n\n## 🚀 Getting Started\n\n### Prerequisites\n- Node.js 18+ \n- npm or yarn\n- NEAR account (for blockchain interactions)\n- OpenAI API key (for AI features)\n\n### Installation\n\n1. **Clone the repository**:\n   ```bash\n   git clone https://github.com/yourusername/funding-ai.git\n   cd funding-ai\n   ```\n\n2. **Install dependencies**:\n   ```bash\n   npm install\n   ```\n\n3. **Environment setup**:\n   ```bash\n   cp .env.example .env.local\n   # Add your OpenAI API key and other environment variables\n   ```\n\n4. **Run development server**:\n   ```bash\n   npm run dev\n   ```\n\n5. **Open [http://localhost:3000](http://localhost:3000)** in your browser\n\n### Environment Variables\n```env\nOPENAI_API_KEY=your_openai_api_key_here\nNEAR_NETWORK_ID=testnet\nNEAR_NODE_URL=https://rpc.testnet.near.org\n```\n\n## 🔍 Usage\n\n### Search Interface\n1. **Enter your funding interests** in the search bar\n2. **Browse results** across the \"All\", \"Projects\", and \"Campaigns\" tabs\n3. **Review evaluation scores** for relevance, impact, and funding needs\n4. **Select items** you want to fund\n5. **Configure funding** amount and strategy\n6. **Execute donations** through the funding modal\n\n### Search Features\n- **Real-time search**: Results update as you type\n- **Smart suggestions**: Pre-defined search suggestions for common interests\n- **Rich results**: View images, descriptions, social links, and evaluation scores\n- **Campaign URLs**: Direct links to campaign pages on Potlock platform\n\n## 🛠️ Development\n\n### Available Scripts\n```bash\nnpm run dev          # Start development server\nnpm run build        # Build for production\nnpm run start        # Start production server\nnpm run lint         # Run ESLint\nnpm run type-check   # Run TypeScript type checking\n```\n\n### Key Components\n\n#### Search API (`/api/search`)\n- **Vector similarity search** using LangChain\n- **LLM-based reranking** with OpenAI GPT-3.5-turbo\n- **Holistic evaluation** with comprehensive scoring\n- **Real-time data fetching** from NEAR smart contracts\n\n#### Main Interface (`page.tsx`)\n- **Responsive design** with Tailwind CSS\n- **Tabbed interface** for different result types\n- **Modal system** for detailed item views\n- **Funding workflow** with amount selection and strategy\n\n#### Data Processing\n- **Project enrichment** with social.near integration\n- **Campaign data** from Potlock contracts\n- **Image handling** with IPFS integration\n- **Social link formatting** for various platforms\n\n## 🔮 Future Enhancements\n\n### Planned Features\n- **Advanced filtering** by category, funding amount, and impact area\n- **User preferences** and personalized recommendations\n- **Donation history** and tracking\n- **Social features** for sharing and collaboration\n- **Analytics dashboard** for funding impact\n\n### Technical Improvements\n- **Caching layer** for improved performance\n- **Real-time updates** for live data\n- **Advanced AI models** for better evaluation\n- **Multi-chain support** for other blockchains\n- **Mobile app** for on-the-go funding\n\n## 🤝 Contributing\n\nWe welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details.\n\n### Development Setup\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests if applicable\n5. Submit a pull request\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgments\n\n- **NEAR Protocol** for blockchain infrastructure\n- **Potlock** for campaign and project data\n- **OpenAI** for AI capabilities\n- **LangChain** for vector search functionality\n- **Tailwind CSS** for styling framework\n\n---\n\nBuilt with ❤️ for the NEAR ecosystem ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpotlock%2Ffunding-ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpotlock%2Ffunding-ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpotlock%2Ffunding-ai/lists"}