Back to .md Directory
GEMINI.md — FIM One Instructional Context
FIM One is an AI-powered **Connector Hub** that serves as a bridge between disjointed enterprise systems (ERP, CRM, OA, Databases) through autonomous AI agents.
ai agent llm rag eval openai gemini workflow
View sourceGEMINI.md — FIM One Instructional Context
Project Overview
FIM One is an AI-powered Connector Hub that serves as a bridge between disjointed enterprise systems (ERP, CRM, OA, Databases) through autonomous AI agents.
Core Architecture
- Backend: FastAPI (Python 3.11+) asynchronous framework.
- Agent Core: ReAct reasoning loops and dynamic DAG planning with concurrent execution.
- Provider Agnostic: Protocol-first architecture using LiteLLM to support OpenAI, Anthropic, DeepSeek, Ollama, etc.
- RAG Pipeline: LanceDB vector store with hybrid retrieval (FTS + RRF) and reranking.
- Frontend: Next.js 15+ (App Router) with shadcn/ui and Tailwind CSS 4.
- Database: Dual-track support for SQLite (development) and PostgreSQL (production) via SQLAlchemy and Alembic.
Building and Running
Prerequisites
- Python 3.11+ with
uvpackage manager. - Node.js 18+ with
pnpm. - Docker (optional, for sandboxed code execution).
Key Commands
- Full Stack:
./start.sh portal(Production) or./start.sh dev(Development with hot-reload). - Backend Only:
./start.sh apioruv run uvicorn fim_one.web:create_app --factory --host 0.0.0.0 --port 8000. - Frontend Only:
cd frontend && pnpm dev. - Database Migrations:
uv run alembic upgrade head. - Testing:
uv run pytest. - Linting/Formatting:
ruff check src/ tests/andmypy src/.
Development Conventions
Git & Workflow
- Atomic Commits: Unrelated changes must be split into separate commits.
- i18n Automation: Only edit English source files (
messages/en/*.json,README.md,docs/*.mdx). Other languages are auto-translated on commit viascripts/translate.py. - Worktrees: Agents must commit on their branch; merge via
git merge, never file copying. - Migrations: Worktree agents must NOT run
alembic upgrade head; only write migration files. Migrations are applied after merging to main.
Backend (Python)
- Async First: Use
async deffor all I/O-bound operations. - Type Safety: Mandatory type hints on all public functions.
- Migrations: All migrations must be idempotent and compatible with both SQLite and PostgreSQL (use helpers in
fim_one.migrations.helpers). - Boolean Defaults: Use
server_default=sa.text("FALSE")orsa.text("TRUE")for PG compatibility.
Frontend (Next.js)
- i18n: Never hardcode English strings; use
next-intl(useTranslations). - UI Safety: Never
rm -rf frontend/.nextwhile dev server is running. - Admin Tables: Follow the
admin-users.tsxpattern: actions in a "..." DropdownMenu, Lucide icons for all menu items, destructive actions last. - Dialogs: Use
AlertDialogsiblings for dirty state protection; avoid nativeconfirm/alert. - Styling: Prefer
focus-visible:outline-*overring-*to avoid clipping.
Project Structure
src/fim_one/
├── core/ # Agent logic (ReAct, Planner, Tools, RAG)
│ ├── agent/ # ReActAgent & Hook System
│ ├── workflow/ # DAG Engine & Node types
│ ├── model/ # LLM Providers & LiteLLM integration
│ └── tools/ # Base tools & Connector adapters
├── web/ # FastAPI App, API routes, and SSE endpoints
└── db/ # SQLAlchemy models & session management
frontend/ # Next.js Application
├── src/components/ # UI components (shadcn)
├── messages/ # i18n JSON files (en/ is source)
└── public/ # Static assets
docs/ # Documentation (Mintlify format)
tests/ # Comprehensive pytest suite
Related Documents
GEMINI.md
Totem — Development Rules
- **pnpm only** (never npm/yarn). Use `pnpm dlx` (never `npx`). Windows 11 + Git Bash. TypeScript strict mode.
aipromptgemini
0
3
mmnto-aiGEMINI.md
MechCAD-MLLM
我们将这一新模型暂定名为 **"MechCAD-MLLM"**(面向机械领域的CAD多模态大模型)。
aillmeval
0
2
WHT222GEMINI.md
Agent Instructions
**Layer 1: Directive (What to do)**
aiagent
0
1
mitchelldschafer