How lyx0902/apexlogic works
ApexLogic is a resumable multi-agent deep-research system. Its main workflow takes a topic through retrieval, evidence selection, report drafting, and review; review routes the run back to research or writing until accepted, limited, or capped. Separate capabilities include persistent run recovery, source-evidence memory, PostgreSQL background execution, and report follow-up operations. The README documents several subsystem links whose implementations were not sampled, so the graph includes those documented capabilities without asserting uncertain internal calls.
Main entry points: runner.py Run orchestrator · researchers.py Research agent · storage.py Backend selection · background.py Background worker
Components 34
User entry
- Streamlit UI
app.py - CLI
main.py
Research workflow
- Research agent
agents/researchers.py - Writer agent
agents/writer.py - Reviewer agent
agents/reviewer.py - Query planning
optim/query_planner.py - Search tools
tools/search_tool.py - arXiv search
tools/arxiv_tool.py - Concept expansion
optim/graph_expand.py - Multi-hop search
optim/iterative_retrieval.py - Adaptive allocation
optim/mab_search.py
Evidence and memory
- Vector retrieval
bge/retriever.py - Evidence reranking
bge/reranker.py - Embedding client
bge/embeddings.py - Memory service
memory/service.py - Memory repository
memory/repository.py
Execution and storage
- Run orchestrator
core/runner.py - Background worker
core/background.py - Backend selection
core/storage.py - Run repository
core/run_repository.py - Postgres run store
core/postgres_repository.py - Checkpoint persistence
core/persistence.py - Postgres access
core/postgres.py - Request cache
core/cache.py
Report operations
- Intent routing
core/intent.py - Follow-up answers
core/followup.py - Report operations
core/report_operations.py - Conversation queue
core/conversation.py
Other components
- Researcher
- LLM service
- Search providers
- BGE API
- Redis
- Research report
Connections 48
- Researcher → Streamlit UI: submits topic
- Researcher → CLI: submits topic
- Streamlit UI → Run orchestrator: creates or resumes
- CLI → Run orchestrator: creates or resumes
- Run orchestrator → Research agent: runs research
- Run orchestrator → Writer agent: runs drafting
- Run orchestrator → Reviewer agent: runs review
- Reviewer agent → Run orchestrator: routes iteration
- Research agent → Query planning: decomposes queries
- Research agent → Search tools: requests search
- Research agent → arXiv search: requests search
- Research agent → Concept expansion: expands concepts
- Research agent → Multi-hop search: retrieves gaps
- Research agent → Adaptive allocation: allocates results
- Search tools → Search providers: queries providers
- arXiv search → Search providers: queries arXiv
- Research agent → Vector retrieval: selects evidence
- Vector retrieval → Embedding client: embeds texts
- Vector retrieval → Evidence reranking: ranks candidates
- Embedding client → BGE API: requests vectors
- Research agent → Memory service: recalls evidence
- Run orchestrator → Memory service: publishes accepted sources
- Memory service → Memory repository: reads and writes
- Memory service → Embedding client: embeds evidence
- Writer agent → LLM service: generates draft
- Reviewer agent → LLM service: evaluates draft
- Streamlit UI → Intent routing: classifies operation
- Intent routing → LLM service: requests fallback
- Streamlit UI → Conversation queue: queues operation
- Background worker → Conversation queue: processes turns
- Background worker → Run orchestrator: executes research
- Background worker → Follow-up answers: answers follow-up
- Background worker → Report operations: updates or verifies
- Follow-up answers → Research report: returns answer
- Report operations → Search providers: fetches new sources
- Report operations → Research report: creates version
- Run orchestrator → Research report: produces report
- Run orchestrator → Backend selection: selects persistence
- Backend selection → Run repository: selects SQLite
- Backend selection → Postgres run store: selects PostgreSQL
- Backend selection → Checkpoint persistence: opens SQLite checkpoint
- Backend selection → Postgres access: opens PostgreSQL checkpoint
- Run orchestrator → Checkpoint persistence: saves run state
- Run orchestrator → Run repository: records run
- Run orchestrator → Postgres run store: records run
- Search tools → Request cache: uses optional cache
- Embedding client → Request cache: uses optional cache
- Request cache → Redis: reads and writes